Hello World!
This is the best, the cleanest, simple and search-engine friendly way to redirect an URL to another URL.
Redirect a single page
As you see, first we write the keyword (Redirect), then the status code (301 Moved Permanently), oldpage (/black-page.html), and the destination path (http://www.russianroot.net/white-page.html or just /white-page.html).
1 2 3 4 |
Redirect 301 /black-page.html http://www.russianroot.net/white-page.html #or Redirect 301 /black-page.html /white-page.html Redirect 301 /black-page.html http://www.russianroot.net/my-folder/ |
Redirect an entire site
This way does it with links intact. This meens that old URL old.russianroot.net/some/great/link.html will become new.russianroot.net/some/great/link.html.
This is very helpful if you want to tranfere your website to a new domain.
You have just to place this code in the root of your old website:
1 |
Redirect 301 / http://new.russianroot.net/ |
List of all redirect status codes you can find in separate article (http://www.russianroot.net/2012/07/19/list-of-http-status-codes/#3xx_redirection)
I hope this article was useful for you! Feedbacks and comments are welcome!=)