简体   繁体   中英

Internal server error when set up Laravel

I try to make a site using Laravel. When I put Laravel to "www" folder and browse

localhost/laravel/public then I get a internal server error.

In error log display the following message.

/var/www/laravel/public/.htaccess: Options not allowed here

before put a post I saw similar problem here https://stackoverflow.com/questions/21097240/ and I didn't see any solution.

This is my .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]

You have a .htaccess file in the directory /var/www/laravel/public with an Options directive in the wrong place.

You can only use the Options directive in a <directory> block.

You need to remove it, move it to the correct place or otherwise edit the file to correct the error.

See the Apache reference here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM