nginx.config location / { index index.html index.htm index.php l.php; #try_files $uri $uri/ =404; 註釋這行(有的話) try_files $uri $uri/ /index.php?$query_string; #加上這行 if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=$1 last; break; } #或者這一行 autoindex off; }