In this post, I will try to cover all the steps required to enable pretty URLs in your wordpress enabled site/blog. I will be assuming that you already have wordpress up and running and if you are having issues with your Custom Permalinks, the following may help you.

First of all, make sure mod_rewrite is enabled. On a Linux server, you can do so by this command :-
[xml]sudo a2enmod rewrite[/xml]

If mod_rewrite is already enabled, you will be told so. So, the next step is to make sure the .htaccess file in your wordpress installation directory is writable. To make sure, that is the case, change it’s permissions :-

[xml]sudo chmod 666 .htaccess[/xml]

Once you change your Permalink settings in admin panel, I would change the permissions back to 664, but that’s upto you totally. At this point, your permalinks should ideally work. However, if they don’t, that’s probably because you need to add a Directory directive to your Apache virtualhost config. Here is what you need to add to your virtualhost config :-

[xml]
<Directory "/var/www/your_web_app">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
[/xml]

Once this is done, you may need to disable/enable your website and then restart apache :-
[xml]
sudo service apache2 restart
[/xml]

And that should be it…your pretty links should now definitely work.

Tagged with:  

Leave a Reply

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

© 2011 Anuj Gakhar
%d bloggers like this: