WordPress File Not Found with Custom Permalinks 2

Linux UptimeWhen setting up a vanilla WordPress installation on a vanilla CentOS server with a vanilla Apache install, I kept getting 404 errors on pages and posts when Permalinks was set to anything other than the default.

I fixed it by editing Apache’s httpd.conf file to add the following in the website’s <VirtualHost> directive:

<Directory /www/vhosts/example.com/htdocs/>
        AllowOverride All

The default set in the httpd.conf file is AllowOverride None, meaning the mod_rewrite wasn’t able to do its job.

If a section like that already exists, and that section contains AllowOverride None, simply change the “None” to “All.”

Be sure to search through the file to make sure there aren’t other configuration options entered in the file below the first one, which might be changing the setting back to “None.”

Once you’re done editing httpd.conf, restart Apache with:

sudo service httpd restart


apachectl restart

That should do the trick!

  • Danson Miller

    I beat my head against the wall trying to figure this out. I ended up finding this and your post among a few others. This did the trick for me

    • Glad you got it figured out, Danson. Yes – it’s possible for settings lower down in an httpd.conf file to squash settings that are up higher. I’ve updated my blog post to take that into account. 🙂