Search code examples
apache.htaccesslaravellaravel-5internal-server-error

500 internal server error Laravel 5


I'm receiving an internal server error on Laravel 5.

My .htaccess files (both one at root and one in /public:

<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

My log:

AH00124: 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.


Solution

  • Within the /public directory .htaccess, you are rewriting urls to point at /public again, so it is endlessly rewriting the url. In the /public htaccess file, the rule would be

    RewriteRule ^(.*)$ /$1 [L]
    

    Check out the .htaccess file that ships with Laravel for reference:

    https://github.com/laravel/laravel/blob/master/public/.htaccess