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 :-

sudo a2enmod rewrite

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 :-

sudo chmod 666 .htaccess

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 :-

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

Once this is done, you may need to disable/enable your website and then restart apache :-

sudo service apache2 restart

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.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 445 other subscribers

© 2011 Anuj Gakhar
%d bloggers like this: