Laravel 5 伪静态
apache:
先激活重写功能:
LoadModule rewrite_module modules/mod_rewrite.so
<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]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
nginx:
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
本文来源:软盟基地,转载请注明出处!如果需要定制开发网站、二次开发程序、搭建微商城、制度平台、小程序商城、多端小程序 请联系我们!
扫一扫,加我微信
先激活重写功能:
LoadModule rewrite_module modules/mod_rewrite.so
<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]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
nginx:
location / {
try_files $uri $uri/ /index.php$is_args$query_string;
}
本文来源:软盟基地,转载请注明出处!如果需要定制开发网站、二次开发程序、搭建微商城、制度平台、小程序商城、多端小程序 请联系我们!

扫一扫,加我微信