Friendly URLs in WordPress (Apache2 / Linux)
Here is a simple step-by-step to enable more readable and more search engine friendly URLs on your WordPress blog. This guide is for people running WordPress 2 and Apache2 on Linux. I wrote this because I could not find a simple step-by-step for Apache2 on Wordpress’s website.
BEFORE: http://www.doctort.org/adam/?p=5
AFTER: http://www.doctort.org/adam/nerd-notes/friendly-urls.html
Step 1: Enable mod_rewrite
$ cd /etc/apache2/mods-enabled $ sudo ln -s ../mods-available/rewrite.load ./ $ sudo /etc/init.d/apache2 reload
Step 2: Create an .htaccess file
$ cd /var/www/html/ $ sudo touch .htaccess $ sudo chown www-data.www-data .htaccess
Step 3: Enable nice permalinks in Wordpress
- Go to Options / Permalinks on the Wordpress admin menu
- Click the custom radio button
- Type the following into the custom field: /%category%/%postname%.html
- Click Update Permalink Structure.
