It’s very Important to know what is 301 & 302 Redirect before changing your website URL. Redirection of a URL mostly use, when you want to move website content from one URL to Another. For example, you may have some content at http://www.abc.com/old and decide to restructure your site. As a result of this move, your content may move to http://www.abc.com/critical-keyword.
Once a redirect is implemented, users who go to the old versions of your pages (perhaps via a bookmark they kept for the page) will be sent to the new versions. Without the redirect, the user would get a Page Not Found (404) error. With the redirect, the web server tells the incoming user agent (whether a browser or a spider) to instead fetch the requested content from the new URL.
Why and When to Redirect
Redirects are also important for letting search engines know when you have moved content. After you move content, the search engines will continue to have the old URL in their index and return it in their search results until they discover the page is no longer there and swap in the new page. You can help speed up this process by implementing a redirect.
Here are some scenarios in which you may need to implement redirects:
- Have old content that expires, so you remove it.
- Find that you have broken URLs that have links and traffic.
- Change your hosting company.
- Change your CMS.
- Want to implement a canonical redirect (redirect all pages on http://yourdomain.com to http://www.yourdomain.com).
- Change the URLs where your existing content can be found, for any reason.
Not all of these scenarios require a redirect. For example, anyone can change hosting companies without impacting any of the URLs used to find content on your site, in which case no redirect is required. However, for any scenario in which any of website URLs change, you need to implement redirects.
Good and Bad Redirects
There are many ways to perform a redirect, but not all are created equal. The basic reason for this is that there are two major types of redirects that can be implemented. These are:
301 Redirect [permanently]
301 Redirect tell Google or other Search engines crawler that the resource has been permanently moved from one URL address to another URL.
302 Redirect [temporarily]
In very simple words, 302 Redirect tell Search engines, that the website content has been temporary moved from one URL address to another. And after few days it will be appear on same URL.
When a search engine crawler sees a 302 HTTP Redirects. It assumes it should not pass the historical link authority from the old page to the new one. In addition, the 301 redirect will lead the search engine to remove the old page from the index and replace it with the new one.
Preservation of historical link authority
The preservation of historical link authority is very critical in the world of SEO. For example, imagine you had 100 links to http://www.yourolddomain.com and you decided to relocate everything to http://www.newdomain.com. If redirects that returned a 302 status code, then it would be starting your link-building efforts from scratch again. In addition, the old version of the page may remain in the index and compete for search rankings in the search engines. Note that there also can be redirects that pass no status code, or the wrong status code, such as a 404 error (Page Not Found) or a 200 OK (Page Loaded Successfully).
These are also problematic, and should be avoided. There are other types of redirects as well, such as those that return a 303 or 307 status code. These also should be avoided, as the search engine’s response to them is at best unpredictable. You want to definitively return a 301 HTTP status code for a redirect whenever you permanently move a page’s location.
Methods for URL Redirecting and Rewriting
As we just mentioned, there are many possible ways to implement redirects. Web servers, (normally present on machines running Unix or Linux as the operating system), it is possible to implement redirects quite simply in standard file called .htaccess using the Redirect and Redirect Match directives. You can also employ more advanced directives known as rewrite rules using the Apache module known as “mod_rewrite”.
Servers running Microsoft IIS