The MU forums have moved to

.htaccess causing rewrite loop (9 posts)

  1. imv79
    Posted 17 years ago #

    I read all the post I could find about this, but I found no solution.

    The problem is the .htaccess provided with the MU instalation is not working properly (at lease for my hosting)

    It is entering a loop and causing the server to return an 500 error.

    Some URL also get 404 (WP page) for file like styles and imagens...

    Anyone have any suggestiong? or a modified .htaccess working?

  2. drmike
    Posted 17 years ago #

    Not without knowing what the issue is I'm afraid.

    Debugging WPMu

    Do you know what part of it isn't working?

    Can you go ahead and post your htaccess file?

    Usually the 500 error kicks something out into the webserver's error logs. Have you checked?

  3. imv79
    Posted 17 years ago #

    Here I send you the .htaccess file (it's the default file included in the instalation):


    RewriteEngine On
    RewriteBase /

    # Rewrite to
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]


    Also I get this error in the server's log:

    [Wed Mar 14 14:44:23 2007] [error] [client] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.

    I'm not really sure what part is not working. Removing this:

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]

    This removes the 500 error, but everything gets 404.

  4. kingler
    Posted 17 years ago #

    The default .htaccess should work fine and it has been tested on many many servers and installations here. Is it possible your host has the MaxRedirects set to very low?

  5. imv79
    Posted 17 years ago #

    The IT guys say the limit is between 20 and 50 which I believe it will be enough.

    Any ideas?
    They told me perphas something with the PATH_INFO variable will help, but I no nothing about that.

  6. imv79
    Posted 17 years ago #

    Anyone any ideas??

  7. dmednikov
    Posted 16 years ago #

    I have the same problem with default .htaccess file. It enters an infinite loop when a url like this provided: (form_buttons directory doesn't exist)

    While is working just fine and generates 404 error generates 500 error (infinite loop)

    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L] seems to be the reason for sending Apache into the loop. But I do not quite understand why Apache doesn't generate 404 for the URL with trailing slash. I get the fact that /trailing slash makes the difference for Apache to interpret URL as a folder, but when it doesn't find the folder should it not generate 404?

    Anyone can shed any light on it?

  8. Farms
    Posted 16 years ago #

    I'd very much like to know the answer to this one too :)

  9. drmiketemp
    Posted 16 years ago #

    Damn if I know. I hate rewrite rules. I always pass them along to my own tech support.

    Gotta admit that I'm wondering why we're trying to access nonexistent subdirectories though.

    I know we've had issues with the trailing slash before that we're raised both here and on the regular wp trac. I'm on a locked down terminal today so I can't open up a new window to double check their status.

    Also I remember an issue with wp and wpmu installed on an addon domain on a cpanel install that causes issues with a missing trailing slash. That was the issue I tried to raise on trac but got closed with a worksforme.

About this Topic

  • Started 17 years ago by imv79
  • Latest reply from drmiketemp