The MU forums have moved to WordPress.org

500 Internal Server Error <> MU RewriteRule causing endless redirection loops (4 posts)

  1. RavanH
    Member
    Posted 16 years ago #

    Hi,

    I find in my error-log file from time to time errors like:

    mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary.

    After some digging and testing I could reproduce these endless redirection loops and I found that the line

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

    near the end of my standard (by MU created) .htaccess file is related to these loops.

    -----------------------------
    Example:

    If I visit a non-existent location on my MU install like http://someblog.site.url/nothingthere (with or without a closing forward slash) I get presented with the standard WP generated 404 page as defined in the theme. (this is on a VHOST setup, but else I would get the wp-signup.php?new=nothingthere page)

    If I visit a non-existent location with "wp-" (only lower case) in it like http://someblog.site.url/wp-content/nothingthere (no trailing forward slash) I get presented with a SERVER generated 404 Not Found page ("The requested URL /wp-content/nothingthere was not found on this server.")

    If I visit that same location WITH trailing forward slash http://someblog.site.url/wp-content/nothingthere/ I get a 500 Internal Server Error page and an error as above gets added to the error log.
    -----------------------------

    My questions are these:

    - Is this the case for everybody or are there server settings (on my shared host) that trigger this?

    - What is that rewrite rule for anyway? If I comment the line out, all seems to work fine (have not tested much though, just browsed a few pages and admin section)...

    - Is there a way to prevent the endless redirections in another way (some RewriteCond) if deleting the line is no option?

    Thanks for any thoughts on this :)

  2. Nightgunner5
    Member
    Posted 16 years ago #

    - Is this the case for everybody or are there server settings (on my shared host) that trigger this?

    I got a 500 error when I was installing the KB Countdown Widget plugin when accessing the bargraph, since it was looking in the wrong place. What happened to me matches your description almost exactly.

    - What is that rewrite rule for anyway? If I comment the line out, all seems to work fine (have not tested much though, just browsed a few pages and admin section)...

    After reading this topic and disabling the rewrite rule, I found that I could not access the admin panel on any blog other than the "Site News" blog. I am using subdirectories, not subdomains.

    - Is there a way to prevent the endless redirections in another way (some RewriteCond) if deleting the line is no option?

    For all I can tell, replacing

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

    with

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

    does the trick.

  3. RavanH
    Member
    Posted 16 years ago #

    Thanks, Nightgunner, for your thoughts. I have no plugins running on the test setup at the moment nor did i try to install one, but still the errors can be provoked like I described above.

    On my setup with subdomains not subdirs, the admin pages are still accessible.

    The rewrite conditions you suggest are already in the .htaccess ... To be complete, here is the whole content:

    RewriteEngine On
    RewriteBase /wordpress-mu-1.3.3/
    
    #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]

    Which, I would guess is standard because it was created bu MU during install.

  4. leonl
    Member
    Posted 16 years ago #

    I have problem with 500 server internal error just after instalation, wp-login page. I delete .htaccess file from enzim control panel and now seems that everything is ok.

About this Topic