having index.php in subdirectory
Hi,
I don't know if it's an issue or if it's my bad, but I've a problem with the routing and the file .htaccess
I put my index.php in the directory /a/b and I want to redirect my request to this directory in the .htaccess. My request is GET http://localhost/myProject/users I follow the documentation without sucess.
.htaccess
RewriteEngine On
RewriteBase /a/b/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
index.php
Flight::route('GET /users', array($UserController,'getAllUsers'));
Flight::start();
I found two solutions to debug it but I can't keep this. with the .htaccess like this
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ a/b/index.php [QSA,L]
- Change the request
http://localhost/myProject/a/b/users
- Put the test route on
/*/users
index.php
Flight::route('GET /*/users', array($UserController,'getAllUsers'));
Flight::start();
Do you know how to :
- request GET
http://localhost/myProject/users - having my index file in directory /a/b
Thank you in advance
See this https://stackoverflow.com/questions/11784073/apache-rewrite-rule-to-redirect-all-request-to-subdirectory-containing-another https://stackoverflow.com/questions/28970616/rewrite-rule-in-subdirectory https://stackoverflow.com/questions/65109212/how-can-i-use-the-htaccess-file-to-rewrite-urls-for-a-subdirectory
This seems addressed. If not, let's create another issue.