Leopard and mod_rewrite
It seems that there are dozens of websites out there with solutions to getting mod_rewrite to work in Leopard. The solution for me was the second set of instructions on Michael Krol’s blog. His instructions were intended for Tiger, but worked for me nonetheless.
Basically the user config file (/etc/apache2/users/USERNAME.conf) needs to be edited to look similar to this:
<Directory "/Users/USERNAME/Sites/">
Options All
AllowOverride All
Order allow,deny
Allow from all
</Directory>
I underlined the parts that are necessary for this to work. Then just restart apache by using the command he provided, or by turning off web sharing and turning it back on right away.
I didn’t need to edit the /etc/apache2/httpd.conf file, although it appears that some people had to, whether out of necessity or because they did both sets of instructions and everything worked, thinking both were necessary. Running 10.5.x, which was freshly installed. Not sure if everything would work on a Mac that was upgraded from Tiger to Leopard.
Also make sure you read up on the Options and AllowOverride settings. Here are the links to the documentation about them:
Options
AllowOverride
Tags: Apache mod_rewrite Leopard
This entry was posted on Sunday, February 10th, 2008 at 10:08 pm and is filed under Apache, Leopard, Mac, mod_rewrite. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
August 16th, 2008 at 4:38 pm
Thanx, was very useful!
November 8th, 2008 at 11:17 pm
Thanks, saved some head bashing. I did these changes in /private/etc/apache2/httpd.conf for others that may be looking for it.
February 25th, 2009 at 5:45 am
Thank god for this. I banged my head for a while before you solved my problem. It’s important that Options is set to All to get mod_rewrite to work in your Sites folder.
March 9th, 2009 at 8:42 am
Thanks mate!
Really helped me out!
April 5th, 2009 at 3:44 pm
Thanks a lot!!! Works like a charm on Leopard 10.5.6.
April 7th, 2009 at 1:00 am
Thank you, thank you. I have been banging my head against the wall for weeks. I knew I had to reconfigure the user.conf file and that “supposedly” mod_rewrite worked out of the box, but it doesn’t, and some other doe-heads out there have the wrong user.conf modifications. I was going to kill someone. (Thanks, I needed to vent.)
April 16th, 2009 at 6:37 pm
Thanks! Glad I could help.
April 17th, 2009 at 8:50 am
Thanks a alot!!
May 23rd, 2009 at 4:24 pm
Hi, nice posts there
thank’s for the interesting information