Redirecting http:// to http://www.

Code, Internet — Jono on June 14, 2007 at 1:18 pm

Seems that this causes problems for people so I thought I could pop it up here as a useful resource. Use the following code and replace “domain.com” with your domain e.g. jonoellis.co.uk. Place all of the code in your .htaccess file and http://jonoellis.co.uk will redirect to http://www.jonoellis.co.uk.

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

0 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. | jonoellis.co.uk