.htaccess Issue...Need help please

Discussion in 'HTML & Website Design' started by SiteExpress, Aug 3, 2009.

  1. #1
    I have installed a wordpress blog on my site, but I get an infinite loop error when I try to access it. I believe the problem is in my .htaccess, and hope someone here can help.

    In my .htaccess I have all non www urls redirected to www. I also have a 301 redirect of index.php redirected to www. mysite .com.

    Here is my .htaccess

    # -FrontPage-
    
    IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*
    
    <Limit GET POST>
    order deny,allow
    deny from all
    allow from all
    </Limit>
    <Limit PUT DELETE>
    order deny,allow
    deny from all
    </Limit>
    AuthName www.mysite.com
    AuthUserFile /home/public/public_html/_vti_pvt/service.pwd
    AuthGroupFile /home/public/public_html/_vti_pvt/service.grp
    
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^mysite\.com$
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
    
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
    RewriteRule ^index\.php$ http://www.mysite.com/ [R=301,L]
    Code (markup):
    How can I write the .htaccess, so that I can keep my current redirects legit, and also still have my blog at www. mysite .com/blog.


    thanks in advance for the help.
     
    SiteExpress, Aug 3, 2009 IP
  2. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #2
    I'm no expert with .htaccess but this seems illogical as the index file is the first file to be accessed, and if you've got it redirecting to www. mysite .com then that will be causing the loop. Try it without that last line and share your results.
     
    Last edited: Aug 3, 2009
    dlb, Aug 3, 2009 IP
  3. SiteExpress

    SiteExpress Well-Known Member

    Messages:
    1,355
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    155
    #3
    Thanks for the reply. the only thing that helps is to remove the redirect of non www to www. by removing that redirect, it fixes the problem of the loop when accessing the blog. However, I need the www redirect.

    Possibly I have it written incorrectly?
     
    SiteExpress, Aug 3, 2009 IP
  4. dlb

    dlb Member

    Messages:
    203
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #4
    I would research other ways of achieving that effect. I guess it's clashing with the other content in your .htaccess file.
     
    dlb, Aug 20, 2009 IP
  5. kokopelli

    kokopelli Peon

    Messages:
    2,436
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #5
    You should remove those redirects from your .htaccess and use WordPress to make the redirects for you.

    The latest versions of WordPress will automatically redirect to www. if you configured your WP URL that way (or the other way round), and you can also exclude the "index.php" part.

    You might have to update your permalinks to get everything to work.

    And did you omit this WordPress part of the htaccess file?
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Code (markup):
    Let me know if I can help.
     
    kokopelli, Sep 30, 2009 IP
  6. SiteExpress

    SiteExpress Well-Known Member

    Messages:
    1,355
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    155
    #6
    Thanks for replying, but this issue was resolved long ago. :)
     
    SiteExpress, Sep 30, 2009 IP