Possible Duplicate:
.htaccess file?
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?

I am looking for exact code for creating .htaccess file used for redirect a simple static page.

Looking forward to positive replies.

Thank You

link|improve this question
feedback

migrated from stackoverflow.com Jun 24 '10 at 5:49

This question came from our site for professional and enthusiast programmers.

closed as exact duplicate by Iain, Chris S Feb 17 at 16:21

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

1 Answer

It doesn't get much simpler than this:

RewriteEngine On
RewriteRule ^foo.html$ /bar.html [R=301]

The effect of this would be users who try to access foo.html getting redirected to bar.html (with the HTTP response code 301).

link|improve this answer
2  
Yes it does. Redirect permanent /foo.html /bar.html – Ignacio Vazquez-Abrams Jun 22 '10 at 7:57
"much" redefined – Lauri Lehtinen Jun 22 '10 at 8:15
feedback