For a simple php site, I want to have friendly URLs. Therefore, I would like my URLs to look like this:
http://mysite.com/page/123
Which indicates:
http://mysite.com/page.php?id=123
And it works! But if I point to a file that is not on the server, apache spikes, and I have to get Apache to exit (developing locally with MAMP, right now).
Here is my .htaccess file. Any ideas?
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([^/=]+)/?([^/]*)/?$ $1.php?id=$2 [N,QSA]
ErrorDocument 404 /404.php
source
share