
While driving on the road many may have faced a road diversion which is done due to some improper functioning or due any such reason.Same is the case with URLs.Whenever there are some flaws in the working of any site or any changes are to be applied then the use of redirects is beign done.
These was just a generalized scenario.Being a SEO or a good netizen you all must be familiar with the technical aspects of the redirection.
Issues that urges the need of redirects
- The first reason is the necessity of the owner of a website to show the domain where he has moved his pages.
- The other reason is just when there are collaboration between the websites.Here,it is necessary to route the users of both the merging sites to a specific new location or URL which has the merging effect of both the sites.
- Whenever any domain is renamed then it is necessary to notify the users.But, if the users are unaware then it is good to redirect them directly which can be even not recognized by the user.
Reasons why we do re-directs
- Nowadays world is being flown towards nano technology i.e every thing is becoming smaller and smaller.The consequences of such technology will one day make it possible to carry your entire planet in a brief case.How funny,isnt it?But it can be true.The reason to mention it here is that,one of such reason is a result of redirection i.e to get a shorter URL instead of a longer.In the field of internet it is recommended to have a shorter URL.Such option is provided by URL redirects.
- It is also used as a replacement for changing URLs.For some websites which are free to be edited,it happens that the content remains same but the url can be changed.Here, the problem is faced by such users who have bookmarked those urls.To overcome these problem,url redirects is used.
- One use of it is for black hat purpose i.e using 302,it can be used to steal page ranks.Usually it was possible some time ago but nowadays the search engine providers have over come such issues by just penalizing the sites using these technique.Cloaking is also done using the redirects.
- The redirects are also used for fooling the users and making them feel of the site they wished to visit but in reality it is not the one they intended.Thus, giving rise to phishing.
How to implement redirection?
There are many ways to obtain the task of redirection.The most popular and oldest one is to refresh meta tags.However, nowadays many other advance techniques are used.Let us have a look at them.
- Simple redirect
These technique is used as an option for those browsers who do not support the automatic redirects.Here the user can reach the destination by just following the link given in the anchor tag.Let us check how does it look like?
Visit:<a href=”http://seoindepth.wordpress.com”>Your Best Guide In SEO</a>
- Using HTTP status codes
The client must take additional action to complete the request.This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. The action required may be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. A user agent should not automatically redirect a request more than five times, since such re-directions usually indicate an infinite loop.
300 – Different Options
It mentions that the user can have any option out of the many available.For example different extensions of a file,different languages etc.
301 – Permanently moved
These technique is used to show a change of location i.e if the domain has changed then we can redirect the old domain to the new one.It is also used to resolve the formation of canonical issues i.e by taking different combination of our url like with www,without www,different cases all these can be solved by just redirecting to a proper url of out site.
Different ways to implement 301 redirect
- Use .htaccess for redirection:
If we use Apache server,the .htaccess files are used for redirection.The coding is done in Apache config files or the .htaccess file.Lets have a quick look at the types of the .htaccess pages.
- .htaccess for Static pages :
Here,we have to code within the .htaccess file by downloading it to our root directory,make the changes and again reload it.
2. .htaccess for Dynamic pages:
For dynamic pages we need the id fo the page that i sbeing used along with the url.
- Refresh meta tag & HTTP refresh header:
Its a feature introduced by netscape.It specifies the url of the new page which is replaces the old one after some defined period of time.Here we need to specify the time out i.e the interval after which the url has to be changed.If the timeout is 0,it is said to be 301.
Here ,the code is placed in the head tag of HTML file.But,these method is considered as a poor technique by the W3C standard because it doesn’t communicate any information about the original & new source to the browser and W3C never prefers auto-refreshing pages as many browsers doesn’t support it.
- Java scripts redirects:
As many browser doesn’t support java as well as due to security resons it is not very prominent.
- Cold fusion redirect:
- Frame redirects:
Here,a HTML frame is created which has the url of the target page.Here,the address of the frame document appears as the url and not of the target page.Usually ,it is used as a cloaking method i.e a black hat technique.
- Redirect Loops:
Here,multiple redirects are being used for a single domain, say for example www.abc.com(improper) is redirected to www.abc.org(proper) then it is further redirected to en.abc.org.It is called as loops of redirect.The maximum limit for such redirects is 5.