开发者

Pylons redirect to 404 error page

开发者 https://www.devze.com 2022-12-25 04:51 出处:网络
What function to I use to redirect to the default 404 error page?Sample code apprec开发者_如何学Pythoniated.Thank you!abort(404) as mentioned in the quickwiki tutorial. See the docs for abort.404 isn\

What function to I use to redirect to the default 404 error page? Sample code apprec开发者_如何学Pythoniated. Thank you!


abort(404) as mentioned in the quickwiki tutorial. See the docs for abort.


404 isn't something you redirect to; there's no distinct "404 page" with its own distinct URL. It's a status code that you send back in the HTTP response, instead of 200 (the code for a normal successful response).

Actual redirects are also status codes, such as 301 or 307, that can be used instead of 200 or 404.

Read about the status line in an HTTP response for more info.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号