globi Posted September 4, 2013 Share Posted September 4, 2013 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 Link to comment Share on other sites More sharing options...
Soma Posted September 4, 2013 Share Posted September 4, 2013 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. Link to comment Share on other sites More sharing options...
globi Posted September 4, 2013 Author Share Posted September 4, 2013 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? Link to comment Share on other sites More sharing options...
kongondo Posted September 4, 2013 Share Posted September 4, 2013 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. Link to comment Share on other sites More sharing options...
globi Posted September 4, 2013 Author Share Posted September 4, 2013 Yes, that's right - the ID is 27 Link to comment Share on other sites More sharing options...
apeisa Posted September 4, 2013 Share Posted September 4, 2013 If you access the page directly, then it will give 200 OK as a header: http://processwire.com/http404/ When accessing url that actually doesn't exist, like http://processwire.com/fasdfkw/ you get 404. 1 Link to comment Share on other sites More sharing options...
ryan Posted September 7, 2013 Share Posted September 7, 2013 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now