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, Login to your websites wordpress dashboard as, http://www.yourwebsite.com/wp-login.php , after entering your admin details, you might be redirected to your dashboard as http://yourwebsite.com/wp-admin/index.php Or if it didn’t automatically redirected then you can type this URL http://yourwebsite.com/wp-admin/index.php 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.
Execution & Command Syntax
sed websites pages / posts and you are getting an error like, “Not Found” “The requested URL /page_or_post_name/ was not found on this serverTechnical Implementation Details
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.
Gotchas and Common Issues
Permission Verification - confirm execution permissions and path variables before invoking system binaries.
Version Compatibility - check software version release notes for deprecated flags or syntax changes.
Log Monitoring - inspect system logs (
journalctlor/var/log) to troubleshoot execution failures.
Following these steps ensures clean configuration, proper security boundaries, and reliable execution for fix wordpress pages / posts 404 error.
Comments and corrections