I develop sites on a mac and have been trying to get mod_rewrite to work unsuccessfully. I have it working at my hosting provider just fine but really need it local to test/develop.
Mac OSX 10.6.6 Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8l DAV/2 PHP/5.3.3
I've tried many variations found on the web with no luck.
At this point I'm just trying to get a test directory, named "mod_rewrite," working.
Here's my /etc/apache2/users/me.conf file:
<Directory "/Users/me/Sites/"> Options Indexes -MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <Directory "/Users/me/Sites/mod_rewrite"> Options All -MultiViews AllowOverride All Order allow,deny Allow from all </Directory>
My .htaccess file in the "mod_rewrite" directory is this:
RewriteEngine on RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L]
Pretty basic for now as a test. As I noted it works fine on my hosting platform.
I restart Apache with each change. Usually there is no change. Sometimes I've broken the whole damn thing. Sometimes I get permission denied for the test directory.