View Full Version : Problems setting up www. redirects

03-19-2011, 10:51 PM
Hi there, I've recently been informed that most of my site maybe misinterpreted by search engines as I don't have 301 redirects set-up and therefore a lot of my pages are appearing as duplicates, a www. version and one without.

So far I've been following this guide on how to set-up the redirects I need:


In one of the first steps it mentions you need apache, which I'm not sure if my host has (1and1.co.uk)

There is also a step to locate the file httpd.conf on my server but i cannot find it anywhere. I've followed all of the other instructions but when I go to my site williammorrismusic.com it doesn't redirect to the www. version. Any ideas?

03-20-2011, 04:42 PM
You'll only be able to access the httpd.conf if you have full control of the machine. If its a shared hosting, you need to cross your fingers that they allow .htaccess to override the type.
All that article (just briefly looked over the code used) looks like it will work in the .htaccess except the directives in the block for Options +..., which I believe can only be set in httpd.conf, and the loadmodule I think is also httpd.conf level only.
Simply use:

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

should work.

03-22-2011, 03:18 AM
Ah I've just discovered I don't have apache as I'm on a windows server so the redirects will have to be done like so:


Does that code need to go on every page then?