Attention! This post is older than three years, it may or may not be relevant anymore.


This post addresses the issue of WordPress permalinks not working, which is a common problem faced by many users. The problem is often caused by incorrect server settings, especially when migrating to a new server or launching on a virtual machine. To solve the issue, you can try adding the default .htaccess file, changing the “AllowOverride” setting to “All” in the Apache2 conf file, and restarting Apache. If these solutions do not work, further investigation may be necessary. Keep in mind that there are numerous ways this setting can be configured, so there is a chance that other server settings may also be causing the issue.

So, there could be many reasons as to why your “Post name” permalinks are not working in WordPress, but this post deals with one of the most common which apparently doesn’t have to do with the WordPress setup or configuration but with the server settings.

The issue, in particular, is when your post URL, like the one below, works:

But the named URL for the post like the one below doesn’t:

The first approach should be to put the default .htaccess for WordPress in the root directory of your setup and see if that works. You may get the default .htaccess code from the official WordPress codex page itself:

If adding/replacing the .htaccess doesn’t work then you may continue reading below and try the solution mentioned.

This issue is most commonly faced when you have migrated to a new server, or you are launching your WordPress site on a VPS or on a Virtual Machine on AWS, Azure, Digitalocean droplet, etc, and the configuration is not correct.

What happens is that the setting to allow WordPress to override the “routes” is not set in the apache2 conf file. The same can bet set in the /etc/apache2/sites-available/000-default.conf file. Taking an example of an Ubuntu Server, your default apache2.conf will look like this:

Path: /etc/apache2/apache2.conf (here we have an example of /var/www/):

And to allow WordPress to change the URLs as desired by the admin in the permalinks settings, you have to change the option “AllowOverride” to “All”. So, the final snippet will look like this:

After making this change, you’d also have to restart apache. You may use the following command for the same:

In case the issue is still not resolved, you may also have to enable “module rewrite” on the server. You may do so by running the following command:

and then again:

This, in theory, should solve the issue in most cases. If not, then further investigation is required.

Again, there are countless other ways this setting could be configured, for example, some system admins don’t wish to change the default config file for apache and prefer to set this setting in the “sites-available” config file, and there’s always a chance that other settings on the server are causing the issue as well.

If you are looking for a reliable team to manage your web development, consider checking out our web development services and pricing page. So in case any of you guys reading this has anything worthwhile to contribute or point out, please share in the comments section below and contact us today!

Thanks again and Happy Coding 🙂