Home Blog Archives Web Design Programming Search Marketing Study Online Subscribe Contact Me

Alfredo's Blog

Web Designer | Search Marketer | Programmer | Philippines | SMS: +639397005929 | YM: alfredopalconit

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:

  1. Change .php to .html using .htaccess or httpd.conf
    It is common that when a site already has so...
  2. About Phishing Sites
    After years of working on different servers for several clients...
  3. Proof of UFOs in Religious Art
    I have always been amazed by the existence of UFOs...
  4. Blogging on hot topics can exponentially boost your traffic
    A Palconit Network member site, L’Ange Bleu, is currently enjoying...
  5. Is the book Rich Dad Poor Dad full of Crap?
    Personally, I loved the book. At first glance on the...
  6. ABS-CBN and GMA Network Wars
    It has been almost a month now that we see...
  7. Why is on page optimization important?
    There are two ways of optimizing a website: on-page and...
View Blog Archives: Click here

Alfredo is a web designer, programmer and a search engine marketer from the Philippines. He is also an amateur photographer and loves to travel. He can be found on Twitter, LinkedIn and Facebook. Questions? Send him an email.

9 Responses to “ SEO friendly redirect domain.com to www.domain.com ”

  1. Filipe Alves Ferreira Says:

    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

  2. Jhay Says:

    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

  3. Alfredo Says:

    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.

  4. shane Says:

    I prefer no-www domains especially with subdomains. :)

  5. Alachsalieskdadsich Says:

    Hi

    Haven’t had much luck finding such a good info! GREAT JOB!
    G’night

  6. JohnDo Says:

    I wanted to thank you for the time you spent building this page.

  7. fish_hfd Says:

    It’s nice

  8. dradaykip Says:

    alfredo.palconit.com – The most necessary site

    Thank you, I will add it to my bookmarks

    regards

    Dolly

  9. Garry Says:

    That’s very cool.. I’m definitely going to apply it on my site

Leave a Reply