WordPress.org

Ready to get started?Download WordPress

Forums

Problem with .htaccess (loop) (10 posts)

  1. macamba
    Member
    Posted 7 years ago #

    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??

  2. DianeV
    Member
    Posted 7 years ago #

    Okay. Does your new provider (in addition to supporting .htaccess) also support mod_rewrite? If not, the above won't work.

  3. macamba
    Member
    Posted 7 years ago #

    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!!!

  4. Chris_K
    Member
    Posted 7 years ago #

    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.

  5. macamba
    Member
    Posted 7 years ago #

    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!

  6. Chris_K
    Member
    Posted 7 years ago #

    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?

  7. macamba
    Member
    Posted 7 years ago #

    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>

  8. Chris_K
    Member
    Posted 7 years ago #

    I look forward to learning what is wrong about it.

  9. Samuel Wood (Otto)
    Tech Ninja
    Posted 7 years ago #

    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.

  10. Dion Hulse
    WordPress Dev
    Posted 7 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.