htaccess rewrite issue while testing on localhost
Posted
by James Doc
on Stack Overflow
See other posts from Stack Overflow
or by James Doc
Published on 2010-06-01T16:59:21Z
Indexed on
2010/06/01
17:03 UTC
Read the original article
Hit count: 376
I'm running OSX (10.6) with Apache with .htaccess enabled.
In the htaccess file I have the code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^page/([A-Z0-9._%+-]+) index.php?page=$1 [NC]
This runs perfectly on my external server and redirects nicely to index.php?page=whatever
However when testing locally from localhost/~james/In%20Progress/Vila%20Maninga/page/whatever I get redirected to localhost/~james/Users/James/Sites/In%20Progress/Vila%20Maninga/index.php?page=whatever. For some reason 'Users/James/Sites/' is being added.
Does anyone why this is happening and how to prevent it?
Many thanks,
James
© Stack Overflow or respective owner