April 3, 201214 yr Hi everyone, Could really use some advice on this one! I'm trying to set up a 301 redirect so if i type in 'buyforyourboyfriend.co.uk' it redirects to 'www.buyforyourboyfriend.co.uk' so google will not think they are two different sites copying content. I made an .htaccess file like this; redirect 301 /buyforyourboyfriend.co.uk http://www.buyforyourboyfriend.co.uk but it didn't work... So i made a .htaccess file like this; redirect 301 / http://www.buyforyourboyfriend.co.uk/ and put it in my root directory, that redirected fine if i typed in the browser 'buyforyourboyfriend.co.uk' but now it wont load any other pages of my website because the .htaccess file doesnt have .htm extensions on the end. Do i have to list every page of my website on the .htaccess file???
April 3, 201214 yr Author Ok scrap this post, think i've done it now! Seems to be working fine anyway! Heres the code i used (i decided on redirecting all to the non www site) RewriteEngine On RewriteCond %{HTTP_HOST} ^www.buyforyourboyfriend.co.uk [nocase] RewriteRule ^(.*) http://buyforyourboyfriend.co.uk/$1 [last,redirect=301] If anyone knows if thats 100% right or not would still be greatful!
Create an account or sign in to comment