-2

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

How to create .htaccess file for 301 permanent redirect. I am looking for exact code that we would put in the file.

Looking forward to hear from you all.

Thanks in advance.

1

2 Answers 2

1

This look like it.

http://en.wikipedia.org/wiki/URL_redirection#Using_.htaccess_for_redirection

Redirect permanent /oldpage.html http://www.example.com/newpage.html
Redirect 301 /oldpage.html http://www.example.com/newpage.html

For Apache after around version 2.2.14

-2

If you don't have a .htaccess file (for instance, on a Windows server) it's possible to redirect individual html pages using a meta tag:

<meta http-equiv="refresh" content="0;url=http://www.example.com/newpage">

This goes in the section along with the other meta tags. The content="0; tells the browser to redirect as sson as the page loads (this can be set to delay for a number of seconds), and the rest of the tag is the URL of the new page.

This isn't the best solution, since it has to be put into every page, and dynamic pages (eg php pages) have better ways to do this.