Answer the question
In order to leave comments, you need to log in
Custom error page for non-existent files: how to do it?
Colleagues, good day to all! I ran into this question:
in the folder with the wordpress theme there is a script for handling requests to non-existent pages - 404.php . On the site I'm working with, there is just a redirect to the main one:
<script>
location.href='http://example.com';
</script>
Answer the question
In order to leave comments, you need to log in
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
. . .
error_page 404 /404.php;
location = /404.php {
root /usr/share/nginx/html;
internal;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question