Timeline for Redirect Restricted Page to 404
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 15, 2018 at 2:05 | comment | added | mopsyd |
No, that is a pretty terrible idea if you like having any kind of page ranking. Search engines only consider pages that return a 404 or any 4xx range header as viewer error, and will happily index anything that returns a 200 page. If you do a redirect, then you are telling crawlers that your not found page is a valid page, and it will mess up your page ranking badly. All you really need to do when you get a 404 page is do http_response_code(404); exit(); . If you want a page, then use get_template_part( 404 ); before exit. That is also much faster than any wordpress functionality.
|
|
Aug 4, 2011 at 7:24 | comment | added | Evan Yeung | Actually I just realized that the 404.php is the template. My mistake. | |
Aug 4, 2011 at 7:02 | comment | added | Evan Yeung | I have thought about using this. But a couple downfalls that I see is that two 404 templates would have to be created and maintained (page and real). The client would have to create a 404 page. And I would like to keep the URL the same. Example, if I go to example.com/restricted, I would not be redirected to .../404/ | |
Aug 4, 2011 at 6:39 | history | answered | Anh Tran | CC BY-SA 3.0 |