Build a Word Press Website Today!!

Click here to Get Started..


How to fix wordpress 404 error for pages and posts

So how do I fix WordPress 404 error for pages and posts?

fix-wordpress-404-error

Recently I found myself rebuilding a blog I had for a website I owned.

The old blog had a widget related bug on my right sidebar panel. No matter what I did to remove the content, the content would remain.

I threw everything at trying to get this fixed. I gave up after a couple of hours and I decided to build a new one and start fresh.

So I went ahead and built a new blog with as few plugins as possible and optimized it so it loads super fast.

After exporting and importing the new content into the blog the new pages would not load in the browser.

Instead I would get a 404 error appear on my webpage.

The first thing I did was log into my Cpanel account and made sure the .htaccess file had the right file permissions set.

Next, I made sure the permalinks were setup correctly as well.

Every time I chose a custom structure link and saved this setting WordPress would default back to the plain structure layout.

So instead of choosing the custom layout I chose the post name structure saved this change and we were good to go.

WordPress-Permalinks

WordPress 404 Error Fix

The fix WordPress 404 error using the solution below though depends where your WordPress is installed.

First make sure there are no htaccess related writable errors on the permalink page.

If your .htaccess file is not writeable then WordPress can not add or make any changes to this file.

To do the following you will need to access your .htaccess file and implement the change there.

Is it installed in your index folder which is www.mysite.com or in a folder such as mysite.com/WordPress?

If your website is in in the index folder of your website such as www.mysite.com use the following .htaccess code

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

If your website is in a folder such as mysite.com/WordPress use the following code.

Make sure to change the folder name from Blog to your folder name exactly how its spelt.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>

 

Thankyou for viewing this article.

Please feel free to join in the conversation by adding a topic related comment below.

Your e-mail will not be visible. However all comments added will be moderated. 

Please stay on topic. Thank You

Leave a Comment