Support » Developing with WordPress » Problem with .htaccess (loop)

  • Hello, my .htacces is causing a problem:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    It causes a loop, so my page wont open. I want to use the friendly permlinks structure, since I moved to a new provider my htacces is not working well.

    Someone can tell me what I should change??

Viewing 9 replies - 1 through 9 (of 9 total)
  • Okay. Does your new provider (in addition to supporting .htaccess) also support mod_rewrite? If not, the above won’t work.

    Thread Starter macamba

    (@macamba)

    Yes, they have it! And it can work if you change something in the thacces that casuses the loop. They changes it once for me, but wordpress changed my htacces again now because i’m doing a new install. Thats why.
    Thanks for your help!!!

    Since your move, have you tried visiting Options -> Permalinks and re-saving?

    If you have to be manually adding something to .htaccess to make it work… well, the host will have to help you there as that’s not the norm.

    Thread Starter macamba

    (@macamba)

    When I try to save that permlinks option the wp-admin tells me that I need to update my .httacces manualy, and it gives me the code that’s posted here

    So then I need to mail de host again that so they can take a look at the htacces?

    Thanks!

    When I try to save that permlinks option the wp-admin tells me that I need to update my .httacces manualy, and it gives me the code that’s posted here

    Well, did you add that code to the .htaccess then?

    Thread Starter macamba

    (@macamba)

    Yes but this code doesn’t work.
    It gives me a loop when I want to open my page (root), I can only open /wp-admin for example, or post-permlinks.

    It’s just that I need to change something in the code to avoid de loop and to keep it working all fine.

    The “wrong” given code is

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    I look forward to learning what is wrong about it.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    That code is not a loop because it does not have a redirect anywhere. It cannot possibly run through more than once.

    In order for there to be a redirect loop, there must be an actual redirect being sent to the browser, forcing it to make another request. This code does not do that, it’s doing a rewrite (without an [R] option), so it does not redirect and does not loop.

    Any loop you have is coming from elsewhere.

    Dion Hulse

    (@dd32)

    Meta Developer

    try changing it to this:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*) index.php
    </IfModule>

    I had a similar issue where mod_rewrite simply refused to work with the default wordpress .htaccess, A 404 error page would be returned for all access attempts.

    D

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Problem with .htaccess (loop)’ is closed to new replies.