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;
function __custom_404( $standard_404 )
{
if ( something_is_true() )
return '/absolute/path/to/custom.php';
return $standard_404;
}
add_filter( '404_template', '__custom_404' );
Related Posts:
- Page returns 404 with POST variables, but not without
- Check IF is a “single product page” and Check the “role” for a Redirect
- Proper method to restrict non logged users into certain pages
- How to redirect on particular page in wordpress? [closed]
- How to change redirect after moving a page to trash?
- Putting footer content in a “page” – Doing it wrong?
- Password Protected Page Not Displaying Content After Entering Password
- Redirect “Sorry, you are not allowed to access this page.” to Home
- How to redirect a page to subdomain?
- Slug is redirecting to 404
- Page not found error when adding text `2 = 2 ^ 1` to the page
- If a page does not exist, include a different page?
- Created php page in wordpress – Error Page can not be reached
- How to redirect a page to another?
- Missing Page, But Still Exists In Preview
- Page redirects to archive
- Unique page URL redirect to file_get_contents() at domain
- Change base URL of pages created by certain users
- Redirect page to default subpage
- WordPress Site Page Exists but Error 404
- Page access only from a specific page in wordpress website
- logout redirect only from admin page
- WordPress page not taking precedence over server directory
- Folder wordpress page redirect
- How to rewrite a page url
- Need 404 behaviour for blank parent page
- redirect index.html inside folder to wordpress page of same name
- How to bypass 404 for certain pages/posts?
- How should I set up a Tumblr blog at a WordPress Page?
- URL redirect to home page issue in word press site
- Loading ACF Field content on a 404.php page
- Pages in wp-admin is not found 404
- Assign Parent Page – Now 404 Error
- WordPress redirects to login page when I enter url.com/index.php
- Add pagination to search.php page
- Cannot use old slug – it just 301s to site home page
- Google indexed pages for one page site
- If searched in a category show different 404 page
- How to change the default location where new post gets stored?
- Very strange problem with occasional 404 errors
- Slug of a child page is accessible with and without the parent slug in the URL
- Add infinite scroll to content splitted post
- Check if wp-login is current page
- How to get current page ID outside the loop?
- How to force a 404 on WordPress
- Contact Form on WordPress Sites?
- Custom templates not showing up in template dropdown
- Redirect Restricted Page to 404
- Get page id by template
- How to prevent automatic redirection of 404 errors and “incorrect” URLs?
- Using pre_get_posts on true pages and static front pages
- Get the content of a specific page (by ID)
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- How to get page title with the page ID?
- Show more than 20 items in pages or posts edit dashboard
- Allowing user to edit only certain pages
- How to display last 3 posts (recent posts) in a static page?
- How to give paged links custom title?
- How to set post slug when using wp_insert_post();?
- How can I keep the content of my pages version controlled?
- How to load javascript on custom page template?
- How to configure WordPress to handle 75,000 pages?
- How to update page status from publish to draft and draft to publish
- Check if is on child-page of a particular page
- Change page template programmatically ?
- Conditional tag to check if ‘page.php’ is being used?
- Customizing the URLs of WordPress Login and Sign-up Pages?
- How to disable posts and use pages only
- featured image as background image on pages
- A check for if is parent page, if has children, if has grandchildren
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- Proper way to get page content
- Access the same page from multiple urls (wildcard)
- Create a page without adding a page in the Database
- Is there a way to change the default page template selection?
- Can I have two child pages of different parents with the same name?
- How do I programmatically generate a 404?
- What methods to use to create small, editable pieces of text for static pages?
- Show Default Editor on Blog Page ( Administration Panel )
- Hide page visual editor if certain template is selected?
- What is the difference between $paged and $page?
- multi page password protection
- Create a “Dummy” parent page for a hierarchy in page listing?
- How do I convert a page’s title to lower case?
- Get top level page parent title
- How to add a specific widget to only 1 page?
- Restrict admin access to certain pages for certain users
- page title, parent tilte and grand parent title
- How to add jQuery script to an individual page?
- WordPress page edit does not save selected template
- Add a Page without header and menus?
- What is an alternative to get_page_by_title()?
- Password protect page with multiple passwords
- Create pages automatically if they don’t exist
- Find empty pages or pages which have less than x characters
- Allow only new sub-pages to be created
- Set page template automatically based on parent
- Editing Complex Pages in Visual Mode
- Link section within page with slash (/) and not hash (#) without reloading the page