How to fix wordpress pages / posts 404 error OR How to fix “404 Not Found error was encountered while trying to use an ErrorDocument to handle the request”

If by some reason you are not able to access your wordpress based websites pages / posts and you are getting an error like, “Not Found” “The requested URL /page_or_post_name/ was not found on this server.” “Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.” even if you can see a home page and are able to access dashboard, then there could be some issues with your websites .htaccess file which resides at the home folder of your website code. To fix this, you can follow below two ways, 1. Login to your websites wordpress dashboard as, , after entering your admin details, you might be redirected to your dashboard as or if it didn’t automatically redirected then you can type this URL and press enter Now, from dashboard settings, go to Settings -> Permalink and select url link types as you want and click “Save Changes”. Once thats saved, this will automatically create .htaccess file in your website home folder in hosting and you should be able to view the pages / posts which were showing 404 error. OR if above method didn’t worked, you can manually create and update .htaccess at your websites source code in top directory as,

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

and save this .htaccess file and now try to access post/pages, and it should be working now.

Android Android Commands Android Java Applications Application Libraries Application Stack / User Interface Bash / Shell Scripts Commands and Packages Compilation Content Management System - CMS Core Kernel C Programs Development & Build Development Environment Setup Errors & Failures Flutter git Go Language Programs Hardware Platforms HTML JAVA Programs Kernel & Device Drivers Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Monetization / Google AdSense Multimedia - Audio, Video, Images NDK / Middleware / HAL OS Concepts PHP Programming Languages RaspberryPi Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Socurce Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized User Interface Web design and development Wordpress Yocto / Bitbake / Openembedded

Leave a Reply / Ask Question