Troubleshooting WordPress Permalinks

Troubleshooting WordPress Permalinks

The Issues

1. Custom permalink 404 Error
2. Web server not reading .htaccess file

So you have your .htaccess file all setup per the WordPress Codex. But your post name links are returning a 404. You have tried modifying your .htaccess file many times. So what gives?

A good test at this point is to add some junk to the .htaccess file. Save it. Test your site. If the site breaks, then you have other issues. If nothing happens, then your server is not reading your .htaccess file. So it will never matter what you put in there. ๐Ÿ™‚

Directory Block

Most likely your web server configuration is not setup properly. For this example we will use Apache, as it comes stock on a Linode. It’s almost always the Directory-block in your apache configurations. You need to add AllowOverride to your block.

To keep things clean I have my virtual hosts in /etc/httpd/conf.d in vhost.conf.

Here is how it may look when it’s not working.

Troubleshooting WordPress Permalinks

And working with the addition of AllowOverride all in the Directory block:

Troubleshooting WordPress Permalinks

What adding AllowOverride all does, per the Apache documentation:

When the server finds an .htaccess file (as specified by AccessFileName), it needs to know which directives declared in that file can override earlier configuration directives.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Site Footer