Home > Web > Redirecting javathinking.com to www.javathinking.com

Redirecting javathinking.com to www.javathinking.com

by paul on April 18, 2009

I thought it would be a good idea to redirect requests to http://javathinking.com to http://www.javathinking.com and I found out how to do that easily here.

Basically I just needed to add the apache directives:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^javathinking.com
RewriteRule ^(.*)$ http://www.javathinking.com$1 [R=permanent,L]

In ISPConfig this can be done easily through the administration console rather than editing the apache config files.

Firebug shows me that I am now getting a 301 redirect when accessing http://javathinking.com.

{ 2 comments… read them below or add one }

Patrick April 20, 2009 at 2:26 pm

That’s funny, I would rather do the opposite. Drop the infamous www from the url, instead of adding it.

David May 9, 2009 at 1:58 pm

Make sure to use uniform root URLs throughout your site and 301 (permanent) redirects so that your Google ranking isn’t penalised.

I’ve also noticed the general opinion on the internet (which is never wrong!) suggests that Google gives “www.” sites a slightly higher ranking. I guess it makes sense, given that traditionally the first part of the URI was used to indicate the protocol (“ftp.” “www.” “gopher.” etc). Now that’s showing my age.

Cheers.

Leave a Comment

Previous post:

Next post: