Can someone please tell me where the 404 redirection occurs?
I am wanting to redirect to a custom template.php instead of the 404 page.
Is this possible to do? If it is can some one provide me with a solution.
Thanks
Ravi
Can someone please tell me where the 404 redirection occurs?
I am wanting to redirect to a custom template.php instead of the 404 page.
Is this possible to do? If it is can some one provide me with a solution.
Thanks
Ravi
You must be logged in to post a comment.
Based on your comments, I think I get what you’re saying. However, you don’t want to redirect on a 404, since it defeats the object of the ‘Not Found’ header.
However, you can filter the 404 template path and pass back your own;
Going off of TheDeadMedic you can try this:
Not 100% that this will work
Or my original answer
at the top of your 404.php add:
Since 404’s happen at the server the best way to redirect a 404 away from WordPress’ 404.php is by adding this to the .htaccess file at your site root.
This must be a relative path, not an absolute path.