• I was getting 500 internal server errors when I navigated to a page on my site that didn’t exist. This should have been a 404 error. When I emailed my webhost to ask why I was getting 500 errors instead of 404 errors, he told me that I have a never-ending cycle of re-writes in my .htaccess file. Here’s the sample error message that my webhost said was generated…

    [Thu Jul 27 23:36:29 2006] [error] [client IP Address Here] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use ‘RewriteOptions MaxRedirects’ to increase the limit if neccessary.

    I have never *personally* added a single line of code to my .htaccess file. Instead, WordPress writes to the .htaccess file.

    I am using the .htaccess file to
    1.) maintain permalinks, and
    2.) re-direct XML feeds to Feedburner.

    My questions are
    1.) How did this happen? and
    2.) How do I get my .htaccess file back to normal?

    Here’s what the .htaccess file looks like now…

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    # Redirect FeedBurner to your own Feed
    RewriteBase /
    RewriteRule ^feedburner_397665/?$ /feed/ [R,L]
    RewriteCond %{HTTP_USER_AGENT} ^FeedBurner.*$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    # These Rules redirect all feed Traffic to FeedBurner
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^feed=(feed|rdf|rss|rss2|atom)$
    RewriteRule ^(.*)$ https://feeds.feedburner.com/my_blognamehere [R,L]

    //Can I delete everything after this, and still be okay?

    RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ https://feeds.feedburner.com/my_blognamehere [R,L]
    RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php https://feeds.feedburner.com/my_blognamehere [R,L]
    # These are the standard WordPress Rules
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Could someone please tell me what lines of code I need to delete, so I can fix this problem?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    I don’t see any loop in there. I also don’t think you can delete any of those lines. What was the URL you were getting?

    Thread Starter jandrews88

    (@jandrews88)

    Hi Otto. I have the line listed below 3 times inside my .htaccess file…

    RewriteRule ^(.*)$ feeds.feedburner.com/my_blognamehere [R,L]
    RewriteRule ^(feed|rdf|rss|rss2|atom)/?(feed|rdf|rss|rss2|atom)?/?$ feeds.feedburner.com/my_blognamehere [R,L]
    RewriteRule ^wp-(feed|rdf|rss|rss2|atom).php feeds.feedburner.com/my_blognamehere [R,L]

    Could I delete 2 of these lines without causing problems? What do you mean by “What URL was I getting”?

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    That’s three lines, and they’re not identical. They each do different things. Unless you’ve got actual duplicates (which you did not post), then no, you cannot get rid of them.

    And what I mean was “what URL were you trying to get”. What was the URL in your address bar? What do you type to make this 500 error occur? In other words, be more specific. Figuring out Rewrites is hard enough even when we have all the information, if we don’t know exactly (and I mean to the very letter) what you’re doing, then it’s impossible.

    In the original post you said “when I navigated to a page on my site that didn’t exist”. What page? What URL?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Never-ending cycle of Rewrites in .htaccess file’ is closed to new replies.