I have this folder structure:
/www/project/web/app.php
I can access it via /project/web/index.php. The problem is that I do not want to have web/ as part of the URL. It should be /project/index.php.
With this .htaccess in /www/project/ folder:
RewriteEngine On
RewriteRule ^(.*)$ web/index.php [L]
It seems to reroute to the correct file when accessed via /project/foo/bar, however, the REQUEST_URI stays intact and is /project/index.php/foo/bar which breaks many things.
How can I change the REQUEST_URI to not contain the project?
To put it simply:
/www/project/.htaccess
RewriteEngine On
RewriteRule ^(.*)$ web/index.php [L]
Accessing the URL /project/foo/bar correctly reroutes to index.php, but the application fails because REQUEST_URI contains /project/foo/bar instead of /foo/bar. project is a folder and should not be part of the request.
Try adding the following to your
/www/project/.htaccess