Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a .htaccess file with the following code

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

But when I visit my site I get this error

[client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The LogLevel debug doesn't give me a backtrace and I don't think increasing the Limit on internal recursion is wise.

Does anyone have experience with this type of error?

share|improve this question
1  
With what URL are you testing this? Can you enable rewritelog? That should give you your answer. Also, if possible, try to put the rewriterules in your config, not in .htaccess – Krist van Besien Apr 14 '13 at 15:08
    
This means you have a loop in your redirect rules, Use 'LogLevel debug' to get a backtrace., please post such a backtrace ... – rcomblen Apr 14 '13 at 15:08
    
I'm testing with a domain name laravel.dev wich would automatically redirect to laravel.dev/index.php but the htaccess from laravel is not working on my server – alrightythen Apr 15 '13 at 7:25
    
I have LogLevel set to debug but I don't see any log with a backtrace. – alrightythen Apr 15 '13 at 7:25

Assume that the request is for /index.html.

Your first rewrite condition says "if the URL requested is not a directory, rewrite it with a redirect to itself with an added slash." So the URL will be rewritten with a redirect to /index.html/. Which will again be rewritten with an added slash, etc ad infinitum. This is why you get the error message.

share|improve this answer
    
hmm this is literally the htaccess laravel 4 uses, which must work. I don't get why it's not working on my server. github.com/laravel/laravel/blob/develop/public/.htaccess – alrightythen Apr 15 '13 at 7:27

In case future folks stumble across this...

I had a similar problem, where my Laravel 5.1 project was giving 500 errors on the browser and Request exceeded the limit of 10 internal redirects due to probable configuration error in the logfile.

I was able to solve it by adding RewriteBase / just after RewriteEngine On in my .htaccess file.

Hopefully this can help someone.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.