If you have been operating a WordPress website for a while, you are probably no stranger to the 404 Page Not Found error. Your screen will show the Page URL not found error while browsing inner pages of your website from the home page.
One of the most common errors, 404 Page Not Found, generally occurs:
- after transferring a new website or,
- when you modify the rules in the .htaccess file.
We have given solutions to either of these problems.
I. Adding .htaccess File
1. Log in to your control panel and open the File Manager.
2. Browse the folder for your WordPress site to locate /wp-content/ and /wp-includes/ folders.
Note: You will have to enable the show hidden files option from the Settings.
3. Open and edit the .htaccess file located in their folder.
4. Paste the code given below.
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # End WordPress
If the folder does not have a .htaccess file, then create a new one in that location.
4. Click the +File button on the top-right corner of the dashboard.
5. Enter the name .htaccess under the New File Name field and click the Create New File button.
6. Edit the file and paste the above code into it.
This solution is enough to fix the 404 Page not found error for most cases.
Note: This problem generally occurs after moving/migrating a website from another domain or location.
II. Revise the Permalinks Structure
1. Log in to WordPress Dashboard with the Admin account.
2. Go to Settings and click on Permalinks.
3. Select Post name and click on Save Changes.
The system will reset your permalink structure to the previous default setting.
After that, WordPress automatically rewrites the .htaccess file, fixing the website’s 404 Requested URL not found error.