What is a URL Redirection?
Blog: NASSCOM Official Blog
Have you ever wondered how a single website can have multiple URLs/ Web addresses? This article will help you understand the concepts of URL redirect, URL masking, types of URL redirect.
What is it?
URL Redirection or URL Forwarding is a technique that is used to redirect your website visitors to another URL. When a user attempts to open a page with a redirected URL, the control goes to another URL. Domain redirection or domain forwarding is similar to this. The only difference is that all the pages in a URL domain are redirected to a different domain instead of just one. For example, example.com and example.net can be redirected to example.org. As a matter of fact, we can redirect our URL to any other URL, website or page that is available online. Redirects use status codes in HTTP protocol.
On the basis of status codes used, URL redirect can be classified into 301 (permanent), 302 (temporary) URL Redirects, and URL Frame (masked redirect).
301 Redirect – Unmasked
URL Redirect 301 is an unmasked permanent forwarding. This type is used when our website is permanently moved from a URL to another and we want search engines to index it. As a result, all the URL traffic will be forwarded to the new URL along with its SEO rating. This method is arguably the best method for URL redirecting/ forwarding.
301 redirects are useful under the following scenarios:
- when we change our site to a new domain.
- When different URLs are used to access the website. If, for example, When our home page can be reached in multiple ways – for instance, consider, via http://example.com/home, http://home.example.com, http://www.example.com or https://www.example.com – we can take one of the URLs as a destination URL and can send users from other URLs to preferred URL.
- When two websites with different URLs are merged and older URLs should be forwarded to the new URL.
When we move a webpage from the existing URL to another, the search engine takes time to discover the 301 redirects, recognize the new URL and acknowledge it with the SEO values and reliability of the older URL. This could be a long process if things do not go right.
302 Redirect – Unmasked
302 redirect is a temporary unmasked redirect. This type is used when a website is temporarily moved from a URL to another. In such cases, search engines will always display the original URL rather than the new URL.
Scenarios in which a 302 redirect is used:
- When the actual page is under maintenance, users can be temporarily redirected to a new URL.
- When you need the existing URL but don’t want to update it all the time.
To illustrate, you are a laptop seller and you have a page named ‘All new laptops’ which has a higher SEO score. If you use 302 redirects, you don’t have to update that page every time a new laptop comes out. Instead, you can just create another URL with new updates and just temporarily redirect the actual URL to the new URL. By doing this, the search engines will show your actual URL with higher SEO value and the users will get redirected to a new URL, which is convenient for you.
- When the actual content is on some other page.
URL Frame/ URL masking/ URL cloaking is similar to URL Redirect, except that the users are not redirected to another URL but the web page is displayed in a frame from the server. As a result, the URL remains the same for the user but he gets the content of redirected URL.
- URL Frame is not good for SEO.
- Content duplication. Every search engine will identify our domains and masked domains as duplicates and decide to serve one over the other; and sometimes, it will not be the one you want. As a result, it is not possible to have a search engine presence for two domains showing duplicate contents.
- There are websites that do not allow masking.
URL redirection can be used for the following scenarios:
- URL shortening
- prevent broken links when web pages are moved.
- To get multiple domain names for a website.
- privacy protection
- phishing attacks or malware distribution.
Minimizing the address of a web page into a smaller form that is easier to track or remember is known as URL shortening. Some URL shortening tools available in the market today are bit.ly, Goog.le and Tinyurl.com. For example, The URL “https://en.wikipedia.org/wiki/URL_shortening” can be shortened to “https://w.wiki/U”.
Resolve issues with broken links
If we don’t do URL redirect when we move our page or modify our URL structure, it will automatically get redirected to a ‘page not found’ 404 error code.
To evade this, always make sure to use a 301 redirect when moving or restructuring URL, which will allow the visitors to reach the new URL even if they are using the old URL.
Website owner with multiple domain names
Most of the web hosts allow you to “park” multiple domains so that they all point to your website. For example, consider three sites, “example.com”, “example.net” and “example.org”, when a user accesses any of the given URL, it directs to the exact same page on the site’s web host. This can be achieved by hosting all the required URLs in the same hosting service.
URL redirection attacks (phishing attacks or malware distribution)
Attackers/ hackers use URL redirection to trick the users by redirecting to malicious websites from a real website to harvest sensitive data or to spread malware.
URL redirection is a very useful service that aimed at helping users point their domains or subdomains to certain specific URLs when necessary. This is mostly needed in cases when some website is no longer available under its original domain name when all the users linking to it need to be automatically informed of this update. Thus, the URL redirection functionality helps domain owners to keep the relevance of the incoming links to their websites.
The post What is a URL Redirection? appeared first on NASSCOM Community |The Official Community of Indian IT Industry.