301 & 302 Redirects in .htaccess
Posted 04-19-2009 at 10:29 PM by Amanti Code
Tags .htaccess, 301 redirect, 302 redirect
“Is canonicalization sabotaging your
website’s performance?
Find out how to fix/avoid this
common issue with 301’s & .htaccess”
website’s performance?
Find out how to fix/avoid this
common issue with 301’s & .htaccess”
For many reasons, it’s becoming more common these days for webmasters to want to update their sites – some for seo301 redirect. Below we’ll examine what they are and how you can use them on your site(s).
Before we begin it’s important to note there are two types of redirects; 301’s and 302’spermanent redirect, or what other experts may refer to as a hard redirect, whereas a 302 redirect refers to a temporary redirect, or soft redirect. One of the most effective ways to redirect your visitors from a location on your site that no longer exists to where you intended for them to land is to implement a 301 redirect. Don’t be discouraged by its technical label, although it does sound kinda cool, as it’s really quite simple. 301 redirects serve to inform visitors to your site that a requested page has been moved permanently and is now situated at a new location.
How do you implement a 301 redirect? First there are several ways to implement a 301 redirect and this can depend on what type of server your hosting is operating on. For example 301 redirects are setup differently if you’re working with an Apache web server or a Microsoft IIS Web Server. To complicate things a little more, 301 redirects can also be written differently if you’re setting it up in PHP (hypertext preprocessor) or in ASP (Active server pages). To find out how to do 301 redirects in Apache .htaccess, IIS, PHP, ASP, and Cold Fusion I’d suggest following the link. I’ve done the homework for you and cross referenced these scripts with W3 Schools and they are very identical. Thus, if implemented correctly they do work.
To configure a 301 redirect for an entire site in .htaccess include the following code in the .htaccess file in the root of the old site:
URL location. purposes, much of which involves restructuring a sites architecture. Usually when a sites architecture changes, pages and directories move to different locations on the server. When pages get removed from their previous location and no page is left to replace it, the location becomes non existent. Visitors to the location will have no where to go (the nasty 404 error messages) and for your human visitors it can become frustrating, resulting in leaving your site to the point of no return. And this is of course not what you want, so to avoid this type of issue learn to setup a both of which share a common purpose however are distinctive of one another. Basically a 301 redirect refers to a
Redirect 301 /http://www.newdomian.com
This will allow all URL’s pointing to the old domain to be redirected your new domain. However if you wish to only redirect a single page or a set of single pages you can also use the following 301 redirect in .htaccess.
redirect 301 /old/old.htm http://www.domain.com/new.htm
Advanced SEO technique tip: Did you know that a lot of webmasters and site owners out there are oblivious to the fact that much of their websites content is unnecessarily duplicated by the search engines? In fact there seems to be a consensus among other SEO experts about such SEO best practices. It seems that many have unanimously adhered to the fact that the top search engines have not yet correctly fixed the canonicalization issues with the [www] and [non-www] version your site (i.e. the search engines still consider http://www.amanticode.com and http://amanticode.com to be separate which can lead to the problem of duplicate content.)
Canonicalization: “The process by which
URL’s are modified and standardised
in a consistent manner”
URL’s are modified and standardised
in a consistent manner”
[…] To read the full 301 302 redirect htaccess article go to amanticode.com destination for advanced search engine optimisation and internet marketing techniques
Total Comments 0









