Archive for the ‘Apple’ Category

OSX Leopard and .htaccess

Friday, August 21st, 2009

Today I got my first Mac. I was delighted to discover that it shipped with Apache and PHP5. So, I spent some time getting MySQL and PHPMyAdmin working on the machine. All of that hummed along at a steady pace where I easily came across the answers to my questions. Then, the snag. I had downloaded the entire blog to my computer and it wasn’t working. I recognized the problem as some sort of .htaccess issue early enough but was unable to find the exact answer to my problem.  I dug around for a while before I found anything even close to the solution that I needed. Several blogs list out multiple steps to enable OSX to allow .htaccess mod_rewrite to happen.

They were all wrong.

My /etc/apache2/users/user.conf looked like this:

<Directory "/Users/user/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>

The only file you have to change to get mod_rewrite working is this one. So, open user.conf:

sudo pico /etc/apache2/users/user.conf

Make it like this:

<Directory "/Users/user/Sites/">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Then you restart Apache:

sudo apachectl restart

And you’re all done. Hopefully this will help somebody.