Recently we have had several cases where we have started to work on a website and found out that there is more than one domain with the same content on the site. Normally this is a completely innocent case; the owner of the website may have multiple domains for the same company or product. For example they may have the .co.uk and the .com version of the domain. Unfortunately it is quite frequent that the client has set up a domain alias for the domains, where the alias essentially duplicates the original.
The problem with this is that it is believed that search engines like Google will perceive the alias as duplicate content and possibly can black mark both sites, penalising you for duplicate content.
If you have multiple versions of your domain or you decide to move over to a new domain it is important that you should implement a 301 redirect for the entire site or for any pages on your site that need redirecting.
A 301 Redirect is a method of telling web browsers and search engines that a web page or site has been permanently moved to a new location. Usually a 301 redirect includes the address to which the resource has been moved. Web browsers will typically follow 301 redirects to the new location automatically, without the need for user action.
A 301 redirect should be used whenever a website is moved to a new domain name (URL) so that search engines will quickly change their indices and, in theory, preserve the search engine rankings that the site had at the previous domain.
How do you implement a 301 redirect?
This depends on what you host your site on, or what language you have used on your site but here are the most common solutions.
IIS Redirect
* 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 on ‘Apply’
ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com/”);
%>
ASP .NET Redirect
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(”Location”,”http://www.new-url.com”);
}
</script>
PHP Redirect
<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com” );
?>
JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/” );
response.setHeader( “Connection”, “close” );
%>
CGI PERL Redirect
$q = new CGI;
print $q->redirect(”http://www.new-url.com/”);
Ruby on Rails Redirect
def old_action
headers[”Status”] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/”
end
Redirect Old domain to New domain (htaccess redirect)
Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
Please REPLACE www.newdomain.com in the above code with your actual domain name.
In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.
Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.
Redirect to www (htaccess redirect)
Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com
The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
Please REPLACE domain.com and www.newdomain.com with your actual domain name.
Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.
How to Redirect HTML
Please refer to section titled ‘How to Redirect with htaccess’, if your site is hosted on a Linux Server and ‘IIS Redirect’, if your site is hosted on a Windows Server.
Did you come straight to this page? Why not sign up to our full RSS Feed or read our latest posts?
Hi, your 301 redirect saved me!
I tried a million people but the;
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/1 [R=301,L]
One worked fine for me!
Moved from .com to .co.uk!
THANKS!!
Please Review This Site, You’ll Like It
Made in china mini digital software
Hi, Your Site is Very Informative, Thanks
Chris mccandless photos
Keep Up The Good WorkRead Your Comment, Loved It bbw pantie hose free
check this link for more informationCheck it,
Just Use this site for more informationFind All Youre Looking for here,, c++ free learning, c++ free learning, hray,
Great JobMaybe THats Why Everyone Likes THis Site., cabinet curio free plan, cabinet curio free plan, =DD,
Great JobMaybe THats Why Everyone Likes THis Site.,
check this link for more informationCheck it, calendar cute free printable, calendar cute free printable, 8-OO,
Now I know Youre Amazing, Great Visions,
Please Look further in this great site,
Bookmark My Site, cam chatting free nude web, cam chatting free nude web, iede,
Just Use this site for more informationFind All Youre Looking for here,, cam free people view, cam free people view, 8O,
Beautiful wishes, camel toe videos free, camel toe videos free, 041,
You Have To Refresh Your Details, camtasia download free studio, camtasia download free studio, ctib,
Dont Stop Showing The World What Youve GotYou Can be very helpfull and see here, canada free giveaways, canada free giveaways, 978,
Have You Seen This? Brilliant!You Need to see this now!, canadian free online dating services, canadian free online dating services, yie,
Im Impressed From The Site, 100 free music top, 100 free music top, %DD,
Check This Out, GREAT Information, 100mb free hosting picture, 100mb free hosting picture, :-))),
It Has Great ResourcesGreat Job, Keep up the good work, car draw free page, car draw free page, gfcf,
Have You Seen This Already?, card christmas free teen online, card christmas free teen online, >:((,
Finally, A Usefull Website. , 110cc bike free pocket sale shipping, 110cc bike free pocket sale shipping, cbdtgo,
You Can Find Everyhing you want here, 132 download dvd free region, 132 download dvd free region, =-))),
You REally Have TO See This…, 1985 cab club ford free wallpaper, 1985 cab club ford free wallpaper, =-[[,