January 31st, 2007

Redirecting to WWW

If you're new here, you may want to subscribe to my RSS feed or email alerts. Thanks for visiting!

If you own your domain, you must have noticed that your site resolves to your domain with or without the ‘www’ prefix. So basically, visitors can come to your site either way. Does that affect your Google juice because does it treat it like two separate domains? I have seen referrals from both in my Mint and wished I could redirect it to just one address for simplicity reasons at least. Google prefers you specify your preferred domain name so as to help them determine PageRank more accurately.

I found a simple solution on John Chow’s website. You have to modify your .htaccess file and add the following code:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(.*)\.ipatrix\.com$ [NC]
RewriteRule ^(.*)$ http://www.ipatrix.com/$1 [R=301,L]

Change ‘ipatrix’ to your domain. This change redirects anyone coming to ipatrix.com to www.ipatrix.com.I made the changes to my .htaccess file and it worked like a charm. If you use the Performancing Plugin in Firefox to write your posts, you might want to reconfigure the setting to include the ‘www’ prefix.

Update: I just noticed that this fix doesn’t really work for individual posts. For e.g if you had a page http://domain.com/post-name, the above code redirects it to the main page i.e. http://www.domain.com instead of http://www.domain.com/post-name. Since I am not sure how the above code can be modified, I suggest you use Enforce WWW Preference plugin. This will use whatever preference you specify in your blog URL settings.

Article Tags >> | |

Related Posts

If you did not find the information you were looking for or were not satisfied with this post then you might want to read the following related posts:

Recent Popular Posts

4 Responses to “Redirecting to WWW”

  1. Abhijit Nadgouda Says:

    I have done the exact opposite, I support no-WWW :-)

  2. Patrix Says:

    Abhijit, I understand your point too. As long as readers don’t have to type in the extra letters, I am fine with either ways. I agree with John that ‘www’ helps to differentiate between other prefixes like ftp, etc.

  3. Paul Goscicki Says:

    Uhm, no-www.org. Really.

  4. Patrix Says:

    Paul, Dinn know no-www was a movement. Really. :)

Popular Tags


Recent Comments

  • Obama after McCain on Keating Five | Spageto: [...] Keating Five Investigation -
  • Amit: I was ticked off that
  • Patrix: @Sampada: Yeah that maverick bs
  • Johnny Flatline: I've been wondering where the
  • Hernando: Palin is an imbecile. Who
  • Ashutosh: I second Gawker's observation. It
  • gawker: I was watching the thing
  • Sampada: I was tired of her
  • Patrix: @sam: Everyone is looking forward
  • Patrix: @Clueless: Thanks for sharing that.
  • Archives

    Categories


Search this site

 (Help)

as   
include results from
sort by

Jump up to the Main Content