Almost after Twenty hours of nerve wrecking and hair splitting search, finally got the much irritating WordPress Permalinks Issue solved for my blog.
Yes, the one you are reading right now.
There are some standard procedures you might not want to skip.
First, check if mod_rewrite is enabled in your Apache config and to enable mod_rewrite in Apache if not already, type the following in your terminal
sudo a2enmod rewrite
It should enable or tell you “Module rewrite already enabled”
Now that mod_rewrite has been sorted, lets get to telling Apache that its alright if the .htaccess file overrides some server level settings.
Look for “AllowOverride none” in your 000-default.conf, httpd.conf, httpd-vhosts.conf and change it to “AllowOverride all” – It is important that you check in all these files as it took me several hours of searching to figure that out as primarily I was tinkering with my httpd-vhosts.conf and httpd.conf and didn’t pay attention to the 000-default.conf file.
Once you’ve made the change, restart Apache using the following command
service apache2 restart
Now, ensure there is a .htaccess file in your WordPress install directory.
If its not there, then create an empty one using the following command in your terminal
touch .htaccess && chmod 666 .htaccess
Don’t worry yet about adding anything in the .htaccess file. WordPress will handle it for you.
Now go to your WordPress Settings and set your Permalinks to whatever options given there pleases you and save the settings. This should generate the required content for the .htaccess file automatically.
You can visit your site and check if the fancy Permalinks are working and then change the permission for the .htaccess file to 644.
That should set you right with your WordPress Permalinks Issue.