URL redirection or redirecting a webpage is useful when you have moved the content of a webpage to another page or domain with the intention of redirecting the visitors to the new webpage automatically.
URL redirection can be done in many different ways. Among the different methods, 301 redirect is considered to be the most efficient and SEO friendly method for redirecting a webpage. It safely redirects you to a different page whenever it is triggered. The HTTP “301” status code is interpreted by browsers and search engines that the web pages are “moved permanently”.
The HTTP 301 code includes the URL of the missing or renamed page(s), followed by a space, then followed by the new location or file name. For instance, redirect 301 /oldFolder/oldPage.htm http://www.yoursite.com/newPage.htm. In the above instance oldfolder/oldpage.htm represents the original folder path and file name, whereas http://www.yoursite.com/newPage.htm represents the new path and filename. Always make sure not to add â€śhttp://wwwâ€ť after the 301 status code.
There are so many methods of using the 301 redirect, including:
- IIS redirect
- PHP redirect
- ColdFusion redirect
- ASP redirect
- JSP redirect
- CGI PERL redirect
- htaccess redirect
Of these different methods, htaccess redirect is highly recommended as it is convenient to manage. Instead of setting redirects on each web page, you can assign the redirect code to the .htaccess file.
Advantages of Using 301 Redirect
- Webpage visitors are redirected quickly and effortlessly
- Easy to implement
- You can redirect from your old pages to the new pages without losing your search engine rankings
It is the safest option when you have to move pages around or change file names.