美文网首页
# laravel 下默认的.htaccess

# laravel 下默认的.htaccess

作者: zhaoxiaohui520 | 来源:发表于2021-11-09 14:28 被阅读0次

刚下载的laravel设置完路由不能访问到,需要.htaccess文件
apache

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

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

nginx

try_files $uri $uri/ /index.php?$query_string;

</article>

相关文章

网友评论

      本文标题:# laravel 下默认的.htaccess

      本文链接:https://www.haomeiwen.com/subject/jpwmzltx.html