Apache mod_rewrite not working properly on Mac OS X 10.6 (Snow Leopard)

Posted by DashRantic on Server Fault See other posts from Server Fault or by DashRantic
Published on 2011-01-17T23:19:51Z Indexed on 2011/01/17 23:54 UTC
Read the original article Hit count: 132

Filed under:
|
|

Hello all,

I'm trying to create a PHP website with clean URLs with Apache's mod_rewrite, using a .htaccess file. mod_rewrite seems to be working, however, it claims it cannot find files on my server that do exist.

Just as a basic test, this is what my .htaccess file looks like at the moment--going to [mysite]/page should redirect to the index.php file:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^page$ index.php

Afaik, I have setup the .conf file appropriately as well:

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

However, when I try accessing the URL setup via mod_rewrite ( localhost/~myuser/mysite/page ), I get this:

Not Found

The requested URL /Users/myuser/Sites/mysite/index.php was not found on this server.

However, that file does exist, and that is the proper location! The site works fine otherwise, if I go to localhost/~myuser/mysite/index.php, everything works fine--minus any sort of clean URLs, of course.

Has anyone seen this before/have any ideas as to what I'm doing wrong?

© Server Fault or respective owner

Related posts about apache

Related posts about macosx