mod_rewrite and relative urls
Posted
by Davide Gualano
on Stack Overflow
See other posts from Stack Overflow
or by Davide Gualano
Published on 2010-03-08T11:49:37Z
Indexed on
2010/03/08
11:51 UTC
Read the original article
Hit count: 208
I'm setting up some simple url rewriting rules using mod_rewrite and a .htacces file, but I've got some problems. If I set up the .htacces this way:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule /index.html /index.php [L]
when I call from the browser this url: http://localhost/~dave/mySite/index.html I got a 404 error.
Using this .htacces instead
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule /index.html http://localhost/~dave/mySite/index.php [L]
everything works fine and I get the index.php page I'm expecting. Am I forced to user absolute urls as the target of a rewrite? Is this a Apache configuration problem?
I'm using Max OS X 10.6.2 with its standard Apache installation.
© Stack Overflow or respective owner