If your website is not properly maintained, you may get the WordPress 404 or “WordPress permalinks not working” issue. However, your visitors will be immediately forwarded to a 404 error page if your website is down for maintenance.
So, are you getting a 404 error or a “WordPress page not found” message from WordPress? Don’t be alarmed! For you, we have a solution.
When a user clicks on a link to a missing page, the WordPress web hosting server will immediately provide an error message to the user, such as “404 Not Found.” Your website’s custom error messages are written in plain text by default. This makes your visitors feel a little befuddled.
Today, I’ll show you how to quickly resolve a WordPress 404 page not found or WordPress “404 not found” issue on your site. So, let’s get started!
Contents
404 Page Error in WordPress (Except Homepage)
Fix for 404 Error in WordPress After Changing Permalinks 404 Error in WordPress (Internet Explorer)
In the database, change and update the WordPress URL. Alternative Method for WordPress 404 Error on Local Servers
At times, your WordPress website pages give you a 404 page not found error except your homepage. In such a situation, you can follow these steps to resolve the issue.
- Log in to your WordPress Dashboard
- Go to Settings → Permalinks
- Select the Default settings
- Click Save Changes button
- Change the settings back to the previous configuration (the once you selected before Default). Put the custom structure back if you had one.
- Click Save Settings
Note: If you are using a custom structure, then copy/paste it in the Custom Base section.
This approach can fix the WordPress 404 not found or “WordPress permalinks not working” bug in some circumstances. If it doesn’t work for you, you’ll need to update the.htaccess file in your WordPress installation’s main directory (where the main index.php file is located). 404 errors are frequently caused by a misconfigured.htaccess file or issues with file permissions.
After Changing Permalinks WordPress 404 Error
First, use FTP to connect to your server and download the.htaccess file, which is placed in the same folder as /wp-content/, /wp-admin/, and /wp-includes/.
Next, open this file in your preferred text editor.
Copy/paste the version of the code that is most suitable for your website from the following link: https://codex.wordpress.org/htaccess. Save the.htaccess file to your hard drive and upload it to your live server.
For example, if you have Basic WP use the code below.
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
How to Fix a 404 Error in WordPress (Internet Explorer)
Except for Internet Explorer, your WordPress website may occasionally run perfectly in other web browsers. This is due to the fact that IE has ignored 404 errors since its inception. However, Microsoft released a system upgrade for Internet Explorer 7 and 8 a few weeks ago that can quickly stop the 404 error from happening on your website, even if your website returns acceptable information.
The solution is simple. You will have to put the code in header.php which is located in your theme folder.
The solution is simple. You will have to put the code in header.php which is located in your theme folder.
header('HTTP/1.1 200 OK');
In the database, change and update the WordPress URL.
Suppose you can see the below error on your WordPress website.
“The requested URL was not found on this server. If you entered the URL manually, please check your spelling and try again.”
If such a situation occurs, you can go to your PHPMyAdmin, then navigate to your database name and select wp-option, for example, blog → wp-option.
Now change the URL like your website URL is https://www.abc.com/blog/ replace it to http://localhost/blog.
Fixing the 404 Error with WordPress on Local Servers
Many designers and developers use a local server to install WordPress on their PCs and laptops for staging purposes. The inability to get permalink rewriting rules to operate is a typical problem that most people run into when installing WordPress on a local server. They try to update the permalinks for posts and pages, but the website eventually displays a “404 Not Found” error from WordPress.
In this situation, you need to turn on the rewrite module in your WAMP, XAMPP, or MAMP installation. For the purpose of this tutorial, I am using WAMP. Navigate to the taskbar and find the WAMP icon. After that navigate to Apache → Apache modules.
It will enable a long list of modules that you can toggle on and off. Find the one called “rewrite_module” and click it so that it is checked.
Then check out your permalinks again whether they are working fine or not.
A Different Approach
You can also use the alternative method. Navigate to the local server. Find the Apache folder, then go to the “conf” folder. Navigate to httpd.conf file. Search for a line which looks like:
#LoadModule rewrite_module modules/mod_rewrite.so
Just remove the “#” sign. So it looks like this:
LoadModule rewrite_module modules/mod_rewrite.so
Conclusion
I hope this advice was useful in resolving your “WordPress 404 page error” or “WordPress permalinks not working” issue. Have you come up with any alternative solutions to this problem? Please let us know what you came up with in the comments area below. I am confident that it will be useful to those who are dealing with similar challenges.
Frequently Asked Questions
Q. Why am I getting a 404 error?
WordPress 404 errors usually occur when you have removed certain pages from your website and haven’t redirected them to other pages that are live. Sometimes, WordPress 404 page error can also occur when you have changed a URL of a specific page.
Q. How do I test a 404 error?
There are multiple tools you can use to test WordPress 404 errors one of which is Deadlinkchecker.
Q. How to edit WordPress 404 page?
On your WordPress dashboard, navigate to Appearance > Theme Editor. Find the file named “404.php file” and edit the file yourself or using the help of a WordPress developer.
Q. How to redirect WordPress 404 page?
On your WordPress dashboard, navigate to Tools > Redirection. There you can apply redirection by pasting the broken URL in the source box and the new URL in the Target box.