I am having trouble with converting the following .htaccess file to app.yaml
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ /index.html [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
</IfModule>
what I did is as below (not working) and I have both index.html and index.php
app.yaml:
- url: /
script: index.html
- url: /.*
script: mod_rewrite.php
mod_rewrite.php:
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
if (dirname($path) == '/' && pathinfo($path, PATHINFO_EXTENSION) == 'php') {
$file = pathinfo($path, PATHINFO_BASENAME);
}
else {
$file = 'index.php';
}
$_SERVER['SCRIPT_NAME'] = '/' . $file;
require $file;