Enable Permalinks for WordPress in Apache web server

Permalinks are `permanent links` that would point to blog posts, categories and tags etc. The permalink mechanism WordPress enabled by default
is not very SEO friendly – it just give an indentifier to each post and refer to them with single parameter.

Default permalink setting:
http://example.com/?p=1

When the search engines crawl the website it gives considerable score for the keywords in the permalink that relates to the page content. Therefore it is advantageous to change the default permalink setting so that you can include meaningful keywords in the permalink structure.

Preferable setting:
http://example.com/sample-post/

However if you’re deploying wordpress on your VPS and using Apache as webserver you’ll have to do some extra configuration to get the permalinks working. Otherwise when you’re accessing each post it would throw 404 errors.

First enable the Apache rewrite module

sudo a2enmod rewrite

Then go ahead and edit the apache configuration file located in /etc/apache2/apache2.conf

Here you’ll have to change the instances of 'AllowOverride None' to 'AllowOverride All'

Changed configuration file entries should look like this:

<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>


<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

after making all these changes restart Apache and you’re good to go.

Ramanan Sharma