nginx URL隐藏index.php

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?q=$1 last;
break;
}
}

location / {
index index.html index.htm index.php;
autoindex on;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}

location /qq/ {
index index.html index.htm index.php;
autoindex on;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
if (!-e $request_filename){
rewrite ^(.*)$ /qq/index.php?=$1 last;
break;
}
}


pasting
posted on 2018-08-04 18:21  降魔  阅读(1253)  评论(0编辑  收藏  举报