This site is for sale,
Learn More
Google PR Improved With Domain Redirection
Point All URLs to www. Domain
Originally Published: February 4, 2005
If you check your backlinks on Google you will often find that there are links to a URL like www.searchenginepromotionhelp.com and different links to searchenginepromotionhelp.com. Even though these may point to the same content these are 2 different domains (NOTE the www in the first URL).
You can improve your page rank on Google by having all variations of your domain name point to one domain, doing this concentrates your incoming links and page rank on a single domain.
This article explains how to redirect a domain using the htaccess file.
Make All URLs Point To One Domain
Here is a way to use the .htaccess file on Apache servers so that all URLs resolve to just one domain. Here at Search Engine Promotion Help I want to use the fully qualified domain name www.searchenginepromotionhelp.com for all URLs. Here is the content of our .htaccess file which makes this happen:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.searchenginepromotionhelp\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^(.*) http://www.searchenginepromotionhelp.com/$1 [L,R=301]
The first line turns the RewriteEngine on so the following code will work.
The second line is TRUE if the host is not www.searchenginepromotionhelp.com. The \ character is required to "escape" the . character. (The [NC] flag means to ignore case.)
The third line is TRUE if host is not an empty string.
The fourth line is executed if the previous two conditions return TRUE. This line says to redirect permanently to the fully qualified domain name (www.searchenginepromotionhelp.com). The L flag means this is the last rewrite directive, the "R=301" flag says to redirect to the rewritten URL permanently (HTTP response code 301).
Test The Domain Redirection
Go here to test your 301 domain redirection , if you have setup the redirection correctly the response code will be 301.
You can see this rewrite code in action with the following URL: http://searchenginepromotionhelp.com. When you click on this URL watch the address bar in your browser's window, you will see the URL quickly change from http://searchenginepromotionhelp.com to http://www.searchenginepromotionhelp.com/
This .htaccess rewrite also works if the incoming URL uses my IP number so this URL also is handled correctly: http://65.18.203.170/
Redirection Conclusions
See Search engine friendly URL redirects for details on how to use a 301 redirect for page or directory redirection
This redirection is intended only for sites where you can edit your htaccess file, for more detailed information see http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html
©2005 SearchEnginePromotionHelp.com, All Rights Reserved.
Site Promotion Articles Indexes:
|