My Very Own Blog.

Flower

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:

9 Responses to “Leopard and mod_rewrite”

  1. August 16th, 2008 at 4:38 pm

    konus says:

    Thanx, was very useful!

  2. November 8th, 2008 at 11:17 pm

    mark story says:

    Thanks, saved some head bashing. I did these changes in /private/etc/apache2/httpd.conf for others that may be looking for it.

  3. February 25th, 2009 at 5:45 am

    swedish boy says:

    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.

  4. March 9th, 2009 at 8:42 am

    Harm says:

    Thanks mate!
    Really helped me out!

  5. April 5th, 2009 at 3:44 pm

    jak says:

    Thanks a lot!!! Works like a charm on Leopard 10.5.6.

  6. April 7th, 2009 at 1:00 am

    Spencer Rose says:

    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.)

  7. April 16th, 2009 at 6:37 pm

    tbaumgard says:

    Thanks! Glad I could help. :)

  8. April 17th, 2009 at 8:50 am

    Parker falcon says:

    Thanks a alot!!

  9. May 23rd, 2009 at 4:24 pm

    Mike says:

    Hi, nice posts there :-) thank’s for the interesting information

Leave a Reply