I have a document structure in which I have a .htaccess
file in the parent directory called Fort
. In that same directory, I have a folder named public
. I have in that public
directory a bootstrap.php
script.
Here is my .htaccess
code:
RewriteEngine On
RewriteBase /Fort
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ bootstrap.php?url=$1 [QSA,L]
I am using mamp and the default url is set to localhost:8888/Fort/
.
My bootstrap.php
script has this code:
<?php
echo $_GET['url'];
For some reason when I pass a url say localhost:8888/Fort/foo/bar
, my bootstrap.php
script returns the url as foo/bar
. But if I pass the url localhost:8888/Fort/
, I get a 403 Forbidden
error, and the bootstrap.php
script is not loaded.