‘Redirect’ is a largely discussed but highly confusing topic among the SEO fraternity, but the function is found to create a huge difference in the search engine optimization efforts. In simpler terms, redirect is a method of forwarding any user and search engine to another URL rather than what is originally requested.
Overview of various redirecting methods
Basically, there are three types of widely used redirects such as 301 Redirect, 302 Redirect, and meta refresh.
- 301 Redirect’ is also known as a permanent redirect. We can take an example of changing the postal address from one division to the other where all the posts on the old address will be redirected to the new address if the change is being reported and registered. Similarly, all the traffic to particular web page, i.e., ‘URL A’ will be routed permanently to another URL, i.e., ‘URL B’. As an impact of which, all the links and link popularity as well as the current SEO status of the old URL will also be automatically transferred to the new URL.
- ‘302 Redirect’, on the other hand, is known as temporary redirect. This is not as widely used as the ‘301 redirect’, but is specifically used at special instances for particular needs. However, this is the easiest of both to be implemented.
The third redirect called ‘Meta Refresh’ is basically the method of instructing the web browser through an HTML command to refresh the original web page after the set time period and land on a different URL after refreshing. When you set this time interval as zero, the meta refresh redirect can serve the function of URL redirection.
Most of the webmasters are still unfamiliar with the concept of redirect and tend to wrongly use these at times. The most common mistake is employing 302 redirect where 301 redirect to be used and vice versa. This may cause troubles in how search engines handle these redirects and assess the SEO value of your web pages. A wrong redirect may end up in significant loss in your website traffic. To avoid such ignorant mistakes, further we will discuss in depth about the most commonly used and authentic 301 and 302 redirects.
More things to know about 301 redirect
301 redirect is ideally used to ensure that the search engines as well as users land on the correct page and information. The 301 status code has to be used only when a particular page is permanently moved to a different location. This will ultimately change the URL of a webpage while it gets displayed on the search engine results.
The website owners or developers hosting their websites on Apache servers have to access ‘.htaccess’ file in the server to accomplish 301 redirect. However, the others keeping their websites on hosting servers running on other platforms should check it with the hosting provider to get more details about how to do it.
As discussed above, a 301 redirect is counted as a permanent relocation. 301 must be avoided in case of any temporary shifts or for A/B testing. Your old page will get replaced and the new page will be shown on the search engine results with the 301 redirect in situations mentioned below:
- Get the links to any of the outdated URL to be landed on the relevant new page.
- Landing on the desired page in case of the merging of two websites.
- When there are several URLs that offer access to your website. In this case, you need to select the canonical URL and implement 301 re-direct to guide traffic to desired page.
- On moving your website to a brand new domain in order to make the transition as smooth and seamless as possible.
- Migrating from http to https.
How to do 301 redirect?
Here, we will have a simple overview of how 301 redirect is administered to divert the traffic through search engines to the content while users try to access it through the old link or their browser bookmarks. However, there are also much more complex and specific advanced uses for 301 redirect including 301 redirect from non-www to a www URL etc., which will discuss in other articles.
When performing a 301 redirect by yourself, you need to consider the type of server on which your site is hosted and note the points mentioned below.
– Hosted on Unix / Apache servers
Step I: Access FTP into the website and root folder download, make a copy of ‘.htaccess’ file to be saved in the backup folder.
Step II: Open .htaccess in an editor like the free Notepad++ in which you have to add a new line below the code.
Step III: Insert the redirect as explained in the following example by paying keen attention to the spacing specifications between words.
“redirect 301 http://oldpageurl.com/OldPage.html
Step IV:Save and upload the edited file on to the server and check whether the redirect is working by accessing the old URL, and see if it is getting redirected to the new page.
– Hosted on Windows servers
Page to page redirection may be a bit problematic in Windows hosting as there should be a page existing at old URL to get redirected to the new. Here are two ways to create the redirect by accessing codebase.
Step I: Put a page at the old URL location i.e., http://oldpageurl.com/OldPage.asp
Step II: There are two methods:
- If it is an ASP website, you should place the below-mentioned code above <html> tag / <!DOCTYPE>:
- If it is an ASP.Net site, then the code to be placed above <html> tag / <!DOCTYPE>:
Step III: Next upload new page and test it by accessing the old URL to see if it is getting redirected.
More things to know about 302 redirect
Many of the webmasters support doing 302 redirects instead of 301 as they believe it helps to avoid the Google aging delay. However, this creates some issues to search engines as to identify what is actually intended as they want to ultimately enhance the user experience. If done improperly, problems like continued indexing of old URL and division of the link popularity between the old and new URLs may occur.
There are some ideal scenarios when 302 Redirect can be effectively used such as when:
- Conducting A/B testing of the web page for its design and functionality.
- Getting the client / user feedback about a new web page without impacting the ranking of the old page.
- Updating the website / page without tampering a consistent experience to the users.
These types of redirects are not used so often because in most of the real-time scenarios, 301 or permanent redirect would a better choice for webmasters. So, while considering the advantages of 302 re-direct, we can see that it will not permanently transfer the reputation of the original / old URL to the new one. With this, once the 302 temporary re-direct is removed, the original URL can instantly and significantly benefit from its previous search engine repute and ranking status the way it did in the past.
If a website has technical issues, the 302 redirect can be used on the main URL (i.e. www.testname.com) to another temporary backup site (www3.testname.com) while the old is being repaired. In some other rare cases, businesses may have to choose shorter URL such as www.businessname.com as their home page URL and then a 302 redirect to be used to take the visitors to a database-driven and more complicated URL as ‘www.productname.brandname.com/home.php?pid=home’ or so. So, the business can show the simple ‘www.businessname.com’ in the search engine results which is much easier for the users to digest.
How to do 302 redirect?
If you are not familiar with website administration and its technical aspects, it is ideal to ask your webmasters to do it, and if you are planning to handle it on your own, check the type of your web hosting server and accomplish it step by step format as shown below.
– Unix / Apache servers
Step I: First FTP into the website and root folder, download, and create a duplicate copy of .htaccess file and then save it at a backup folder in order to restore from the actual file in case of mistakes. Take your server administrator’s help if you cannot find the .htaccess file at the FTP file list.
Step II: Open .htaccess in a text editor program like Notepad++ which can be downloaded for free.
Step III: Put the redirect at the bottom of the code by adding an extra line as below by carefully taking care of the spacing in between.
“redirect 302/OldPage.html http://newpageurl.com/NewPage.html”
Step IV: Save the changes and upload the file back to server and test whether the redirect is functioning properly by going to the old URL.
– Windows server
If your site is hosted on Windows servers, 302 redirect can also be a bit painful the same way as it is in case of 301. There should be a page existing at the old location in order to get the visitors redirected to the new destination. There are two ways to create redirect as pointed below.
Step I: Put a page at the location of the old URL i.e., http://businessname.com/OldPage.asp
Step II: There are two options for additional code placement:
- For a standard ASP site, place the following code in front of the <html> tag or <!DOCTYPE> as:
- If it is an ASP.Net website, then put the following code before <html> tag / <!DOCTYPE>:
Step III: Upload the new page at the new location and further test it by trying to access the old URL to see if it is getting redirected properly.
Now you have a clear-cut idea about 301 permanent redirect and 302 temporary redirect, what purposes they serve, and how to do each at various settings. Before ending the discussion, let us have quick look once again at the major usage of 301 and 302 redirects in light of e-commerce or online business requirements.
Consider 301 redirect in situations such as:
- If you are changing the URL of an online store.
- Replacing an outdated page about a product that is no longer available. In this case, you may want to redirect the users to the product category or alternative products they may like.
- An online store is fully moved to a new domain as a part of a business merger or revamping.
- An online store with multiple domains and all getting indexed.
- Domain names with and without “www” to land on the same page.
- To let the URL with a slash and without slash lead to the same page.
Consider 302 redirect when:
- Redirecting from certain items that are not in stock now but may be available later.
- There are any technical revamping happening on the online store temporarily.
- You want to show the users any new information without changing the original content of a page, i.e, special discounts, or seasonal offers.
- It is necessary to hide a particular page from the users, but you don’t have access to the admin panel of the site. This can also be used by the hosting companies if they identify any malicious or prohibited content.
In any case, redirect is considered as a critical step in ensuring that a website is highly search engine and user friendly. Similar to it, there are a lot of other search engine friendly elements contributing towards maximum search engine performance, and to know more about those, you can contact us.