Pretty permalinks
18 03 2008My friend Alfredo Matos has redesigned his website (which, by the way, looks very nice) and I noticed that he had a lot better looking permalinks than me. So I decided to investigate what wordpress offered me to beautify my URLs. After googling a little, I got to this page which basically explains that you can have three types of URLs in wordpress:
- Ugly (the default option): something like
http://www.mydomain.com/?p=X - Almost pretty: an intermediate option for those running an apache without mod_rewrite - it looks something like
http://www.mydomain.com/index.php/about-me - Pretty: the holy grail and the option that I use now - it looks something like
http://www.mydomain.com/about-me
Cutting out the bullshit the only thing you need to do is to allow .htaccess to be readable by www-data and enable mod_rewrite in apache.
sudo a2enmod rewrite
sudo /etc/init.d/apache2 force-reload
You will also probably need to change AllowOverride directives in apache sites enabled from None to All, otherwise rewrite directives in .htaccess will be ignored. There are other ways to do it, but this the simplier one but surely not the most secure.
Tags: HowTo, Linux





