I have a 404 file and it is working with nginx. However when I modify the 404 file to redirect the user it does not redirect.
visiting http://site.com/404.php
redirects the user.
visiting http://site.com/askllj299lakj
is just a blank page.
The code in the 404 file is just a header redirect,
<?php
header('Location: http://site.com/');
exit;
?>
Why doesn't this work in nginx?
http://site.com/askllj299lakj
and see if you can view the text. If yes, then try using php echo to display the same text and see if that works. Are you using PHP FastCGI – Anagio Jun 8 '12 at 9:29<?php
would cause these symptoms and would leave messages about it in your error logs. – Ladadadada Jun 8 '12 at 22:48