Jump to content

Recommended Posts

Posted

Hallo!

I've noticed that my 404-page is actually returning 302 header.
How could I send the proper 404 header to the browser?


Regards,
Mick

Posted

How have you noticed? What 404 page are we talking about? PW default 404 page?

It correctly throws an 404 header. It will not (of course) if you access it directly via url then it will be a 200.

A 404 in templates, you could write

throw new Wire404Exception();

This will render the 404 page and send correct 404 header.

Posted

There's a hidden page with the name "http404" and title "404 Page Not Found" which uses "basic-page" template.
I'm not sure if that's default or not?

Any clue?

Posted

There's a hidden page with the name "http404" and title "404 Page Not Found" which uses "basic-page" template.

I'm not sure if that's default or not?

Any clue?

That is the default. It has ID=27.

Posted

If you get a 302, my guess is that you are accessing a URL with another RewriteRule behind it. For instance, if you are enforcing trailing slashes via an .htaccess file, and you access a URL without trailing slashes, then Apache will first redirect to the same URL with a slash (which could be a 302), and the resulting page will have a 404. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...