MAMP and .htaccess / mod_rewrite
Ahh, the wonderful world of web-serving. It’s a joyous thing if you know what you’re doing and a down-right hair-pulling extravoganza if you don’t.
I myself probably sit somewhere in the middle there… I have a basic understanding, but mostly tend to fumble my way through life while holding a Tech Admin’s hand. :P
I have been struggling for the last couple of weeks with MAMP and clean URL’s in wordpress. MAMP is a great system that’s super easy to install and get running, but it doesn’t play so nicely with Wordpress sites because of the way wordpress creates permalinks - so it’s been near impossible for me to do all my testing locally.
Well, tonight I dove straight into the configuration file and found the beast that has been creating wrinkles in my forehead. It seems that everything in MAMP is setup for mod_rewrite to work (the apache module used to create permalink “clean” URL’s), but they have made a directive that ignores the .htaccess files:
// You can find this on line [647]:
<directory "/Applications/MAMP/bin/mamp">
Options Indexes MultiViews
AllowOverride none
Order allow,deny
Allow from all
</directory>
Take careful note of the “AllowOverride none”; This is our problem child. Simply change that whole block to this:
<directory "/Applications/MAMP/bin/mamp">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</directory>
Save, Restart and rinse… I mean… go!
Happy serving!