Mod_rewrite (CakePHP routing functionality) forbidden after Snow Leopard upgrade

Posted by Ryan Ballantyne on Server Fault See other posts from Server Fault or by Ryan Ballantyne
Published on 2009-10-01T04:19:04Z Indexed on 2010/03/26 20:53 UTC
Read the original article Hit count: 475

Filed under:
|
|
|
|

Hello ServerFault,

I am using the standard Apple-provided installations of PHP 5.3 and Apache 2 to do web development on a Mac Pro that I just upgraded to Mac OS X 10.6 (Snow Leopard). The upgrade went well enough, if I ignore the fact that it destroyed my ability to get work done. ;)

After the update, the CakePHP application I was developing started giving me 403 Forbidden errors when accessed. Based on the errors in the log file, I've determined that Apache is choking on the mod_rewrite rules in Cake's .htaccess file. Here's the file, in its entirety:

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

It's not that the rules themselves are wrong, but that Apache is forbidding the use of mod_rewrite altogether. All other pages on the machine work fine, and the 403 errors go away if I comment out the .htaccess file (but nothing works, of course).

In my httpd.conf file, I've tried changing this:

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

To this:

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Allow from all
</Directory>

...which has no effect.

I don't know much about Apache configuration files, and I'm quite stuck on this. In fact, I know little enough that I'm not sure which information about my setup is needed to enable people to provide useful answers. I'm just using the vanilla OS X setup, nothing fancy.

Googling has yielded no fruits for me this time, so I'm turning to you. Any ideas?

© Server Fault or respective owner

Related posts about apache

Related posts about mod-rewrite