domain.com and www.domain.com

aidan1980

Free Member
Jan 16, 2008
1,321
149
Leicester
how do i sort it so thebookiesoffers.co.uk redirects to www.thebookiesoffers.co.uk using the 301 redirect? I'll need it explained in basic laymans terms aswell please as im a bit of a thicko when it comes to stuff like this:D

cheers in advance
 
FTP/SFTP into your server. Look for a file called .htaccess in the root of your site. If there isn't one create one and paste this in:

Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^localhost$
RewriteRule ^.*$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]

If you already have one only past in the last 3 lines unless yo don't have the rewriteengine line in there.

That will to to http://www. redirects for any site.

If it doesn't work you will need to get one specifically to look at it because there may need to be things that need to be set up.
 
Upvote 0
FTP/SFTP into your server. Look for a file called .htaccess in the root of your site. If there isn't one create one and paste this in:

Code:
RewriteEngine On
 
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^localhost$
RewriteRule ^.*$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]

If you already have one only past in the last 3 lines unless yo don't have the rewriteengine line in there.

That will to to http://www. redirects for any site.

If it doesn't work you will need to get one specifically to look at it because there may need to be things that need to be set up.

just tried making a new file in my root (im using dreamweaver) and it said invalid file extension when i tried to open it to edit it. where have i gone wrong

p.s, told you im a thicko with this stuff:D
 
Upvote 0
just tried making a new file in my root (im using dreamweaver) and it said invalid file extension when i tried to open it to edit it. where have i gone wrong

p.s, told you im a thicko with this stuff:D

Sounds to me like Dreamweaver doesn't allow you to create this file. Try using Notepad. Can't really give advice beyond that since I don't use Windows.
 
Upvote 0
why redirect?

Dependant on your server/setup, tapping in one or other should get yu to the same place!
 
Upvote 0
FTP/SFTP into your server. Look for a file called .htaccess in the root of your site. If there isn't one create one and paste this in:

Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} !^localhost$
RewriteRule ^.*$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,QSA,L]
If you already have one only past in the last 3 lines unless yo don't have the rewriteengine line in there.

That will to to http://www. redirects for any site.

If it doesn't work you will need to get one specifically to look at it because there may need to be things that need to be set up.

This is assuming that they are running linux or unix on an Apache Webserver and if they are running windows on IIS then this advice is not going to help much.
 
Upvote 0
without sounding like an arse can you just put the actaul code up that will redirect thebookiesoffers.co.uk to www.thebookiesoffers.co.uk please mate so i can copy and paste? I have now fixed it so the file works:)

Try this (if your site is hosted on Apache):

Code:
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^thebookiesoffers.co.uk [NC]
RewriteRule ^(.*)$ http://www.thebookiesoffers.co.uk/$1 [L,R=301]
 
Last edited:
Upvote 0

Latest Articles