helpchrisplz
asked on
need help with htaccess file please
hi i am new to htaccess files. i would like to redirect the following urls
anniefontainelifecoach.co. uk
www.anniefontainelifecoach.co.uk
anniefontainelifecoach.co. uk/index.h tml
anniefontainelifecoach.co. uk/index.h tml/
http://www.anniefontainelifecoach.co.uk/index.html/
to:
http://www.anniefontainelifecoach.co.uk/
basicaly i would like all verions of the url to redirect over to http://www.anniefontainelifecoach.co.uk/
i have tried this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^anniefontainelifecoach.co .uk$
RewriteCond %{HTTP_HOST} ^www.anniefontainelifecoach.co.uk$
RewriteCond %{HTTP_HOST} ^anniefontainelifecoach.co .uk/index. html$
RewriteCond %{HTTP_HOST} ^anniefontainelifecoach.co .uk/index. html/$
RewriteCond %{HTTP_HOST} ^http://www.anniefontainelifecoach.co.uk/index.html/$
RewriteRule ^(.*)$ http://www.anniefontainelifecoach.co.uk/$1 [L,R=301]
but its not working. :(
can any one advise please?
anniefontainelifecoach.co.
www.anniefontainelifecoach.co.uk
anniefontainelifecoach.co.
anniefontainelifecoach.co.
http://www.anniefontainelifecoach.co.uk/index.html/
to:
http://www.anniefontainelifecoach.co.uk/
basicaly i would like all verions of the url to redirect over to http://www.anniefontainelifecoach.co.uk/
i have tried this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^anniefontainelifecoach.co
RewriteCond %{HTTP_HOST} ^www.anniefontainelifecoach.co.uk$
RewriteCond %{HTTP_HOST} ^anniefontainelifecoach.co
RewriteCond %{HTTP_HOST} ^anniefontainelifecoach.co
RewriteCond %{HTTP_HOST} ^http://www.anniefontainelifecoach.co.uk/index.html/$
RewriteRule ^(.*)$ http://www.anniefontainelifecoach.co.uk/$1 [L,R=301]
but its not working. :(
can any one advise please?
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{THE_REQUEST} ^.*/index.html
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
ASKER
Number-1
i try your example but it didn't work
GaryC123
that works but http://anniefontainelifecoach.co.uk/
and
http://anniefontainelifecoach.co.uk/index.html
are still available.
i try your example but it didn't work
GaryC123
that works but http://anniefontainelifecoach.co.uk/
and
http://anniefontainelifecoach.co.uk/index.html
are still available.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's great thank you
http://dense13.com/blog/2008/02/27/redirecting-non-www-to-www-with-htaccess/
RewriteCond %{HTTP_HOST} !^anniefontainelifecoach.c
RewriteRule ^(.*)$ http://anniefontainelifecoach.co.uk/$1 [R=301,L]