Hello everyone,
I want to make it so whenever someone tries to access a page that doesn’t exist, he gets redirected to lets say 404.php
I could get it done for the following examples:
I know nothing about nginx except that it attempts to emulate Apache.
Very simply, the Apache solution is
ErrorDocument 404 /404.php
If that doesn’t work for you (it should), then trying to use mod_rewrite code will not likely be of any benefit. If that’s the case, may I recommend that you go back to the website where you got the nginx and look for their support forum and someone there should know how to implement the ErrorDocument function (check if the requested file exists and, if not, redirect to the specified file) for you.
Their official forum seems to be really dead…
Anyways I posted there we’ll see if i’ll get anything, the question is still valid here too incase someone knows…
Syntax for nginx is different as you see I use
error_page 404 /404.php;