Answer the question
In order to leave comments, you need to log in
nginx. Any text after a slash in the address does not redirect to the main page. How to fix?
Good afternoon.
Raised a landing page on nginx.
All OK. But if we allow to write in the address site.com/fwefs0-fs-9dfusd9 and go, then this bilibird remains in the address. But I would like to have a redirect to the main page in case of this.
Config:
server {
listen 80;
server_name site.com;
location / {
root /var/www/site.com;
index index.php;
try_files $uri =503;
}
location ~ \.php$ {
set $root_path /var/www/site.com;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $root_path$fastcgi_script_name;
include fastcgi_params;
fastcgi_param DOCUMENT_ROOT $root_path;
}
error_page 503 /index.php;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question