1

In my nginx default conf file I have:

error_page 404 /?p=error&c=404&r=3;

This loads index.php and runs through a bunch of code, possible resulting in PHP wanting to redirect to where it found the file. The issue is I can't make it redirect. The code below returns a blank white page, with the HTTP headers having the correct Location Header but the status still says 404 which is presumably why Firefox isn't redirecting.

header('HTTP/1.0 302 Found'); header("Location: ".$root.'/'.$url); die();

Any help on how to fix this would be great, thanks!

Also if it helps this server is running Ubuntu, Nginx and PHP-FPM

1 Answer 1

1

Fixed by changing

error_page 404 /?p=error&c=404&r=3;

to

error_page 404 = /?p=error&c=404&r=3;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.