SEO friendly redirect domain.com to www.domain.com
Last week, I noticed that there is a PageRank difference between palconit.com and www.palconit.com. http://palconit.com is PR3 and http://www.palconit.com is PR0. To make all my traffic and PR to go to http://www.palconit.com, I applied .htaccess 301 redirect.
.htaccess redirect
Most major sites redirect their site from domain.com to www.domain.com (see Google, Yahoo, Microsoft, etc.), so I made it a point to apply it on my site. To do this, create an .htaccess file on your root directory and add this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
This will redirect domain.com to www.domain.com
If you prefer to use domain.com than www.domain.com, you can visit http://no-www.org/ and read what they think about this. Also take time to read Matt Cutt’s advice on URL Canonicalization.
php 301 redirect
Here is the code in index.php:
< ? php
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.palconit.com” );
?>
Thanks!
Check my other posts:
- Change .php to .html using .htaccess or httpd.conf
It is common that when a site already has so... - About Phishing Sites
After years of working on different servers for several clients... - Proof of UFOs in Religious Art
I have always been amazed by the existence of UFOs... - Blogging on hot topics can exponentially boost your traffic
A Palconit Network member site, L’Ange Bleu, is currently enjoying... - Is the book Rich Dad Poor Dad full of Crap?
Personally, I loved the book. At first glance on the... - ABS-CBN and GMA Network Wars
It has been almost a month now that we see... - Why is on page optimization important?
There are two ways of optimizing a website: on-page and...
9 Responses to “ SEO friendly redirect domain.com to www.domain.com ”
Hi Alfredo,
I\’m very happy to meet you. You are my first contact in Phillipines. I\’m in Spain, at Pontevedra.
Regards/Filipe. Visit loscedros17.spaces.msn.com
Hmm…pretty interesting. I wonder which is more SEO friendly? http://www..domain.com or domain.com? I mean does it matter for searcg engines? From my experience, people always remembered the domain.com and quickly disregarded the www. prefix. It\’s saves tongues from twisting and saves you four extra keystrokes especially when most Pinoys access the net tru cafes which they have limited time. Visit jrocas.com.ph
I am not sure if search engines prefer www or no-www in ranking sites. It is just that there is a PR difference in domains with www and without www. When it comes to human-friendliness, its easier to remember the no-www than saying www everytime we mention a site. One example why this is important is the STI website. check out their sti.edu.ph (it has nothing on it) and sti.edu.ph with www. The webmaster must have overlooked this one.But major sites are redirecting their no-www domain to www. I am not sure why but I think it is nicer to look at.
I prefer no-www domains especially with subdomains. :)
Hi
Haven’t had much luck finding such a good info! GREAT JOB!
G’night
I wanted to thank you for the time you spent building this page.
It’s nice
alfredo.palconit.com – The most necessary site
Thank you, I will add it to my bookmarks
regards
Dolly
That’s very cool.. I’m definitely going to apply it on my site
Leave a Reply