WordPress Generating 404 Error After Post/Page Creation

I was recently running into some issues with WordPress where it was generating a 404 error on all posts and pages on the site. There were a couple solutions that worked so I thought I'd share with everyone.

Step One
Ensure that you have your .htaccess file generated and that it's permissions are set to be readable. If the .htaccess file is already there and its permissions are okay, check to see if you have the mod_rewrite snippet in place, if not, it's below. Copy that. If you don't have an .htaccess file you can simply create one in your root directory for your install and add the following:

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

# END WordPress

Step Two
Because we've just created a new .htaccess file we'll need to reset our Permalinks back to the WordPress default. This essentially clears any caches that were created by the Permalinks being set. If they're already the default Permalinks, change them to one of the others, save and switch back after.

Step Three
Now that you've set your Permalinks back to the default, go in and change them back to your custom settings. This should fix your issues right now.

About Robb

Hi, I'm Robb Clarke - a Fredericton, New Brunswick based Web Designer and Developer. I'm currently working with OrangeSprocket as one of their Front End Developers. Please take a look around my site and give the Blog a read (or the Shorts if you're looking for a shorter read about none industry related stuff) or stop by my Portfolio to see what I've been up to lately. Most importantly - don't be a stranger.

Comments

blog comments powered by Disqus