Reputation: 392
I have this .htaccess:
RewriteEngine On
RewriteRule ^/test$ /home.php
So mysite.com/home.php
and mysite.com/test
are supposed to be the same now?
But when I go to mysite.com/test
I get a 404 error.
Any help?
Upvotes: 3
Views: 1305
Reputation: 784958
That is because of leading slash in your rule.
Change that to:
RewriteEngine On
RewriteRule ^test/?$ /home.php [L,NC]
.htaccess
is per directory config hence Apache doesn't match leading /
while matching a URI `/test1
Upvotes: 1