Sun 24 Dec 2006
Sometimes we need to change our URLs for certain reason eg for changing the page name from xyz.html to xyz.php or changing domain name for using our keywords in them for ranking, Just renaming them will not serve our purpose because old pages will still be available for user and they will get 404 error pages for those renamed pages, worst is for spiders they may get lost in such case.
The solution for this is to use redirects. We can implement the change in name without affecting SEO by using redirects such as 301 redirect or 302 redirect.
301 Redirect ( Permanent redirect ) :
It is best method for redirecting. It tells spiders/visitors that the requested page has been moved permanently at a new specified location. Implementing 301 redirects is very risky job, if anything gets wrong while using 301 your site will get out of search results, there are many webmasters who have suffered.
There are several methods of using the 301 redirect, you can use redirect in PHP, redirect in ASP, redirect in ASP .NET, redirect in JSP (JAVA), redirect in IIS, redirect in ColdFusion, redirect in CGI/PERl , redirect with mod_rewrite and finally the one I find most useful, the redirect using htaccess.
# 301 Redirect using .htaccess : ( On LINUX server )
Using htaccess to accomplish the 301 redirect is highly suggested due to it being fairly convenient to manage, rather than setting redirects on each individual page, you can simply add the redirect code to the .htaccess file.
# 301 Redirect for IIS : ( On Windows server )
In Internet Services Manager, right click on the file or folder you wish to redirect. Select the radio titled “a redirection to a URL”. Enter the redirection page, check “The exact url entered above” and the “A permanent redirection for this resource”. Click “Apply”.
302 redirect ( Temperory redirect ) :
It can be considered as a command line invitation for getting your site banned, since search engines don’t like temporary redirects.
2 Responses to “301 Vs 302 redirect :”
Leave a Reply
You must be logged in to post a comment.



















December 26th, 2006 at 2:06 pm
While implementing 301 redirects on linux/unix server using .htaccess be careful, sometimes even a small mistake can be hazardous for your site, you will also have to keep patience as spiders takes time to understand the changes in your URL structure to register in search engines.
After applying redirect you should inform about the change to your link partners so they will make it.
August 18th, 2007 at 8:29 pm
302 Redirect Implemented in .htaccess File
Assuming the web server allows it, it is easy to implement a 302 redirect in .htaccess.
Redirecting a page
Redirect /file-name.html http://www.yourdomain.com/tempdirectory/temporary-file-name.html
Redirecting a directory
Redirect /directory http://www.yourdomain.com/tempdirectory/
Redirecting an entire site
Redirect / http://www.temporary-yourdomain.com/
Regards,
Tuks