Show 404 option not working correctly.
-
When selecting the option:
Issue a Page Not Found (404) error for feed requests
… a request for https://domain.com/feed/ renders the view:source of the 404 page, as if it’s parsed with
<pre>
tags. It does not render the template.The other redirect option does work as advertised.
I would suggest a modification to the else condition on lines 134’ish by changing:
else { $wp_query->is_feed = false; $wp_query->set_404(); status_header( 404 ); }
to:
else { $wp_query->is_feed = false; $wp_query->set_404(); status_header( 404 ); wp_redirect(home_url('404'), 302); exit(); }
Works by forwarding the user requesting domain.com/feed/ to domain.com/404 – ideally it should 404 without the URL rewrite, but for now this should work with most WP installs.
Hope this helps others.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show 404 option not working correctly.’ is closed to new replies.