Clean URL support in MAMP
I am trying to setup a website on my Mac using MAMP. I put my website content into a folder under
/Applications/MAMP/htdocs/positweb
"positweb" containins index.php which tries this redirect:
header("Location: web/main");
Along index.php I have .htaccess file, which came with the website:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
I have also enabled "AllowOverride All开发者_如何学运维" inside
<Directory "/Applications/MAMP/Library/htdocs">
element in both httpd.conf and httpd-std.conf files.
Now, my problem is that these redirects don't work on my setup. Chrome says that the link "http://localhost/positweb/web/main" is broken, Firefox says that index.php is not found.
All of the php/.htaccess files are exact copies of a working version of the site. I tried playing around with Apache settings like I described above, but with no luck, and now I don't know what else to try.
My MAMP version is 1.9.5.
Any suggestions are appreciated. Thanks.
Try changing your base_url
in the bootstrap.php from /
to /positweb
And make sure you've got FollowSymLinks
turned on in your httpd.conf
.
精彩评论