Я хочу имитировать этот .htaccess переписанный в Google App Engine app.yaml с использованием PHP:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ query.php?q=$1 [QSA,NC,L]
</IfModule>
Я сделал это:
runtime: php55
api_version: 1
threadsafe: true
handlers:
# mod_rewrite by forwarding the requests to query.php?q=...
- url: /services/(.+)
script: services/query.php?q=\1
# Serve images as static resources.
- url: /(.+\.(gif|png|jpg|ico|svg))$
static_files: \1
upload: .+\.(gif|png|jpg|ico|svg)$
application_readable: true
- url: /(.+\.(html))$
static_files: \1
upload: .+\.(html)$
application_readable: true
# Serve php scripts.
- url: /(.+\.php)$
script: \1
- url: /
static_files: index.html
upload: index.html
application_readable: true
Но в результате всегда не найдена ошибка:
"POST /services/login HTTP/1.1" 404
Я думаю, что обработчики этого не улавливают. Любая подсказка, чтобы сделать это правильно?