私のWebサイトには、「index.php」と「page.php」の2つのページしかありません。入力したものは何でも、localhostにリダイレクトされます。たとえば、404.htmlにリダイレクトされるのではなく、localhost/randompageに移動すると、localhostに移動します(つまり、index.php)
ここに私のconfがあります:
server {
listen 80;
server_name localhost;
root html;
index index.php;
location / {
if ($request_uri !~* '\/|page\.php\?.*') {
return 404;
}
try_files $uri $uri/ /index.php;
}
error_page 404 /404.html;
location = /404.html {
root html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
何を変更すればよいですか?