Cannot figure out why mod_rewrite isn't working

freaky

OSXer
I just had to restore my iMac which runs OS X and had to reinstall Apache, PHP, and MySQL. I remember I had this problem when I first got it working a year ago and forget what was causing the problem. I'm using a mod_rewrite script to convert query strings to search engine friendly URLS (see below). I have mod_rewrite compiled into Apache (yes I restarted) and have Options and AllowOverride both set to All. Whenever I try to go to one of the URLs, it says the page could not be found.

Code:
RewriteEngine On
RewriteRule ^([-a-z_]*)/?$ /index.php?section=$1 [L]

Does anybody have any ideas what's causing the problem? This same script worked fine until I had to reinstall Apache and PHP. I'm pretty sure it's some setting that needs to be changed in the httpd.conf or php.ini.
 
I am having what looks to be the same problem. All I have determined is that it seems to change the path of the file during the rewrite slightly so that it does not work. For instance when I attempt to go to

http://tibook-g4.local/~USERNAME/test/old.htm

with the following rewrite rule:

RewriteRule ^old\.htm$ new.htm

it tries to find the file and gives this error:

The requested URL /Users/USERNAME/Sites/test/new.htm was not found on this server.

notice that it is no longer looking in http://tibook-g4.local/~USERNAME/test/ but rather the actual directory location.

Im not sure why it rewrites incorrectly but it must be correctible.

Perhaps you have found a solution since posting your problem, I would love to hear about any solution,
Thanks,
Bryan
 
Back
Top