菜单

apache和Nginx隐藏index.php的配置

2017-06-29 - Developer

apache

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

 

nginx
location / {
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}

转载请注明: 转载自—艾瑞可erik

本文链接地址: http://erik.xyz/1218.html

发表评论