Weird .htaccess redirect problem.

Discussion in 'Site & Server Administration' started by Ulquiorra, Jun 1, 2008.

  1. #1
    Hi,
    I'm currently trying to redirect non www- requests to my website http://www.deepsarchasm.com to www requests using the htaccess file. However, when I do that, it just goes back and forth between www and non-www and never stops (visit to see what I mean).

    Here's the stuff in my htaccess:

    Can anyone help?
     
    Ulquiorra, Jun 1, 2008 IP
  2. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #2
    Check the error logs of your site.. Hope you will get the idea what is wrong.

    Kailash
     
    kailash, Jun 1, 2008 IP
  3. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Fixed it.

    Wordpress was thinking that the url is http://non-www/

    Soon as I fixed it, it does the redirecting for me - so all is well.
     
    Ulquiorra, Jun 1, 2008 IP
  4. kailash

    kailash Well-Known Member

    Messages:
    1,248
    Likes Received:
    42
    Best Answers:
    0
    Trophy Points:
    190
    #4
    You can try the below rules:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www.domain.com$
    RewriteRule ^(.*)$ http://www.domain.com [R=301,L]
    Code (markup):
    It should work.

    Kailash
     
    kailash, Jun 1, 2008 IP