index.htm to domain.co.uk

Discussion in 'Apache' started by SEO-Warrior, Mar 2, 2008.

  1. #1
    I have this in the .htaccess file

    Options +FollowSymLinks
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^domain\.co.uk
    RewriteRule ^(.*)$ http://www.domain.co.uk/$1 [R=permanent,L]
    Redirect 301 etc etc (various - all working OK)

    I have tried adding a Redirect 301 statement to redirect index.htm (and ideally index.html) to domain.co.uk

    Redirect 301 /index.htm http://www.domain.co.uk/

    Every time I try, I get a home page error message saying it cannot resolve the redirect.

    Help please
     
    SEO-Warrior, Mar 2, 2008 IP
  2. bleeber

    bleeber Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you are creating a permanent redirect, why not do it at the domain level? It's better for SEO anyway.

    If you still wish to do it from the server itself:

    RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
    Code (markup):
     
    bleeber, Mar 3, 2008 IP
  3. bogart

    bogart Notable Member

    Messages:
    10,911
    Likes Received:
    509
    Best Answers:
    0
    Trophy Points:
    235
    #3
    This works for me. Cheers.

    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
    RewriteRule ^index\.html$ http://www.domain.co.uk/ [R=301,L]
    Code (markup):
     
    bogart, Mar 5, 2008 IP
  4. SEO-Warrior

    SEO-Warrior Peon

    Messages:
    140
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thanks Bogart - works for me too!
     
    SEO-Warrior, Mar 6, 2008 IP