php - Laravel .htaccess not working -
laravel's default .htaccess file gives error on php cloud server.
error:
option multiviews not allowed here
when remove section below .htaccess home page work other routes gives 404 error.
<ifmodule mod_negotiation.c> options -multiviews </ifmodule>
original .htaccess file
<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] </ifmodule>
based on these google results here , here, think need append/edit:
rewritebase / rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l]
so in total:
<ifmodule mod_rewrite.c> rewriteengine on rewritebase / # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l] </ifmodule>
Comments
Post a Comment