As far as I can see, it is not possible to use a custom 404 ErrorDocument
directive in your htaccess file because WordPress’ index.php will always be found when processing the htaccess content. (unless ofcourse index.php got deleted for some reason)
Because index.php is found, it will not trigger the ‘404 not found’ ErrorDocument
directive. The ErrorDocument
directive will thus be ignored.
That is – if you stick with the htaccess code generated by WordPress (which I strongly recommend).
It is possible to work without the htaccess rules that WordPress generates, but it requires you to write htaccess rules for the processing of permalinks etc yourself.
I did this in a project where I decoupled WordPress almost completely from the frontend, but I can’t recommend doing that for ~98% of the use cases. 🙂
Related Posts:
- Serve apache 404 for missing assets rather then wp 404 template WP_Rewrites
- WordPress site displaying 404 for any page apart from index
- WordPress keeps deleting .htaccess file
- HTAccess stops me from accessing WordPress Dashboard links
- Site searches by Python for non-existent assets
- WordPress 404 on Subdomain
- WordPress overrides custom 404 page with it’s own
- Fixing custom 404 pages broken by WordPress in a subdirectory
- WordPress category with 404 error
- 404 error Additionally 403 Forbidden error on a URL
- My Homepage Suddenly Disappeared and I Can’t Get It Back
- “Oops.” error on an html file directly uploaded to a subdirectory of my WordPress site
- htaccess redirects invalid request to home page not 404
- Downloading zip or tar.gz inside WordPress installation?
- Clicking PUBLISH Now Redirects to 404 PAGE NOT FOUND
- After changing permalink, getting 404 for one particular category
- Installing wordpress on subdirectory 2 levels down
- Cannot Override WordPress 404 for a Sub-Directory
- Issue after changing permalink structure [duplicate]
- Why ‘Authorization Required’ is coming on wordpress login
- Home page returns 404
- Permalinks not working on debian with OVH
- Best collection of code for your .htaccess file [closed]
- Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error
- How to create custom 401, 403 and 500 error pages?
- Default .htaccess file for WordPress?
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- Which one does WordPress prioritize when it comes to php.ini, wp-config and .htaccess?
- Improve wordpress security by hiding non public resources
- WordPress site hacked. Has .htaccess been hacked?
- Does this .htaccess security setting really work?
- htaccess problem after saving Settings
- multisite 404 error for subdirectory
- Stop WordPress and Plugins from Overwriting .htaccess
- File and directory permissions
- htaccess disable WordPress rewrite rules for folder and its contents
- htaccess rewrite conflict with wordpress rules and ssl
- htaccess https redirect from www to non-www
- Htaccess for Wordpess set on single subdomain
- adding rewrite rules in .htaccess
- .htaccess and 500 error, extra character added
- Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”
- Place static HTML files in path below WordPress page
- Static raw HTML page
- WordPress + Magento .htaccess ReWriteRule Issue (www vs. non-www)
- Plugin to edit htaccess file
- htaccess rewrite for author query string when WP is in subfolder
- Why “Settings->Permalinks” creates .htaccess file on nginx server?
- .htaccess for wordpress inside another wordpress install
- .htaccess file redirecting to parent directory
- Blog.php or how to display recent posts?
- Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
- Globally force SSL on all pages
- Isolating WordPress to a subfolder
- Remove year and month in URL using .htaccess
- index.php not loading in main folder of wordpress
- Admin-Ajax.php, SSL, Non-SSL
- How disable SSL redirect for specific URL?
- How do I skip wordpress’s 404 handling?
- Why does the header set X-Robots-Tag apply to all pages?
- Permalinks not working on second wordpress installed in a subdirect
- How to avoid wordpress permalink rules to inherit in a sub-folder
- Error:406 not acceptable
- Unable to access WP admin
- .htaccess Rewrite URL WordPress
- removed index.php now all pages 404
- Move wordpress to folder without changing urls
- Rewrite rule not working
- A plugin changes my .htaccess file and I can’t access httpd.conf as that’s a shared server
- Cant block wordpress readme files
- Change wp-content without changing the name of the folder
- 404/500 error on /wp-json
- Correct htaccess to display page while also passing in GET parameters
- What is the role of .htaccess file in WordPress?
- Using “wordpress_logged_in” to restrict direct access to uploads folder in 2021
- Using WordPress only for the backend, and using AngularJS as a frontend
- Temporary .htaccess blocking is disabling WP Crons from running?
- How to restrict access to wp-content, wp-includes and all sub-folders
- Two domains on one WordPress Installation
- .htaccess redirects disappeared after re-saving permalinks
- Protect Upload Folder Files With Ampersand Problem
- How have I misconfigured basic auth for my wordpress site?
- Remove File Extension for Page Outside of WordPress
- Is it possible to dynamically redirect URL using htaccess?
- How can I code my plugin to safely modify .htaccess?
- Prevent users from browsing through the media galleries
- .htaccess for wordpress in separate folder
- How to modify the .htaccess to force ssl on login and admin pages
- WordPress URL/Folder ReWrite using Htaccess
- WordPress trims off the forward slash when import
- Which WordPress scripts need to be executable for a fresh installation?
- WordPress mod_rewrite is canceling/overwriting my other mod_rewrite rule
- .htaccess and WordPress Admin Bar
- WordPress best solution shared theme for consumers and businesses (two url’s one instaltion)
- Keep getting 401 error from WordPress on AWS Lightsail
- Redirect main domain to subdirectory
- Blocking access to wp-login via htaccess not working
- Why specific file directory fails to redirect but its parent folder succeeds?
- Setup Permanent 301 Redirects after moving to Https [closed]
- .htaccess redirects no longer work