1. Home
  2. WordPress
  3. Fix WordPress Posts 404 Error after changing Permalink!
  1. Home
  2. Web Server
  3. Fix WordPress Posts 404 Error after changing Permalink!

Fix WordPress Posts 404 Error after changing Permalink!

Question: I changed the default permalink structure to postname, but now all the WordPress posts throw 404 not found error. However, the WordPress has updated .htaccess with necessary rules and below is the snapshot of it.

# 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]

How to solve this error?

wordpress posts 404 erro

Most of the WordPress users face this error and the common scenario goes like this – the user will be allowed to access WordPress admin panel and the main page of the website. But whenever the posts or pages accessed, the web server throws 404 Not found error. If you are getting a similar error, then here’s how you can fix it.

Step 1: If you are running WordPress in Apache web server, then make sure  ‘AllowOverride‘ directive set to ‘all’ under <Directory> tag as shown below:

<Directory "/var/www/html/">
 AllowOverride all

Step 2: Restart the web server.

# /etc/init.d/httpd restart

Step 3: Try accessing the WordPress post page and it should work.

What is AllowOverride?

AllowOverride all” directive tells web server to use .htaccess to allow override the Apache configurations on a per directory basis. When ‘AllowOverride None‘ is set, the web server will ignore .htaccess and that’s where WordPress is going to write permalink settings.

Hope it helps!

Updated on September 1, 2017

Was this article helpful?

Related Articles


Add A Comment