投稿 评论 顶部

nginx设置伪静态

佚名 网络安全

?

#apache<IfModule mod_rewrite.c>RewriteEngine OnRewriteCond %{REQUEST_FILENAME} !-d?RewriteCond %{REQUEST_FILENAME} !-f?RewriteRule (.*)$ index.php/$1 [L]</IfModule>#apache转nginxlocation / {         if (!-e $request_filename) {        rewrite ^/index.php(.*)$ /index.php?s=$1 last;        rewrite ^(.*)$ /index.php?s=$1 last;        break;    }            }#方法二nginxlocation / {    try_files $uri $uri/ /index.php$is_args$args;}

http://www.xx.com/site/index? ?就可以正常解析访问了