.htaccess & Wordpress

Discussion in 'Search Engine Optimization' started by macz_g, Oct 29, 2006.

  1. #1
    I am trying to redirect http://example.com to http://www.example.com

    THe site is using wordpress and I can't find an existing htaccess file so I created a new one with the following code. I saved it in the root folder of the site. I am using hostgator with add on domains.


    But this throws the server in a loop that will never resolve. I am not sure if I have to find an existing htaccess file and add to it or this file is in the wrong place.

    Any help would be greatly appreciated.

    Thanks
     
    macz_g, Oct 29, 2006 IP
  2. cormac

    cormac Peon

    Messages:
    3,662
    Likes Received:
    222
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
    RewriteRule .* http://www.domain.com/ [L,R=301]
     
    cormac, Oct 29, 2006 IP
  3. macz_g

    macz_g Well-Known Member

    Messages:
    108
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Thanks for the quick reply
    I copied it straight but still get an error. I think there may be an existing htaccess that is conflict but I can't find it using cpanel or my ftp client?

     
    macz_g, Oct 29, 2006 IP