mmvsbg
mmvsbg

Reputation: 3588

.htaccess file causes 500 Internal Server Error

My .htaccess file causes 500 Internal Server Error

    Options -Indexes

    AddDefaultCharset utf-8
    #DefaultLanguage bg
    ServerSignature Off

    <IfModule mod_rewrite.c>
            RewriteEngine on
            RewriteBase /
            RewriteCond %{REQUEST_URI} !webroot
            RewriteRule    ^$    webroot/    [L]
            RewriteRule    (.*) webroot/$1    [L]
    </IfModule>

The mod_rewrite module is on and I think that the line that causes the problem is this one:

RewriteRule    ^$    webroot/    [L]

If I drop the RewriteRule lines from the file it all works but as soon as I add them I get the 500 error. I have just some basic knowledge of .htaccess files so any tips and explanations are more than welcome. Thank you!

EDIT: For reference, here's the .htaccess file in the webroot folder, as requested in the comments:

Options -Indexes
AddDefaultCharset utf-8
#DefaultLanguage bg
ServerSignature Off
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>

I'll try to access the apache log files and see if I can get some guidance from the records there.

ANOTHER EDIT: Here are the apache logged errors:

[Sun Jun 14 14:27:19 2015] [error] [client SOME_IP_ADDRESS] 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., referer: SOME_REFERER [Sun Jun 14 14:27:19 2015] [error] [client SOME_IP_ADDRESS] 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., referer: SOME_REFERER [Sun Jun 14 14:27:19 2015] [error] [client SOME_IP_ADDRESS] 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., referer: MY_DOMAIN_NAME [Sun Jun 14 14:27:19 2015] [error] [client SOME_IP_ADDRESS] 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., referer: MY_DOMAIN_NAME [Sun Jun 14 14:27:20 2015] [error] [client SOME_IP_ADDRESS] 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., referer: SOME_REFERER [Sun Jun 14 14:27:20 2015] [error] [client SOME_IP_ADDRESS] 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., referer: SOME_REFERER [Sun Jun 14 14:27:20 2015] [error] [client SOME_IP_ADDRESS] 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., referer: MY_DOMAIN_NAME [Sun Jun 14 14:27:20 2015] [error] [client SOME_IP_ADDRESS] 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., referer: MY_DOMAIN_NAME

Upvotes: 0

Views: 962

Answers (1)

Toheeb
Toheeb

Reputation: 13

You used a RewriteRule Option at the end of the line [L], Make sure there are no leading or trailing space in the braces. i.e

[L ] or [ L]

Upvotes: 0

Related Questions