ADAM'S WEB PRESENCE

18 June 2006

Friendly URLs in WordPress (Apache2 / Linux)

Filed under: Nerd Notes — adam @ 9:20 am

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

  1. Go to Options / Permalinks on the Wordpress admin menu
  2. Click the custom radio button
  3. Type the following into the custom field: /%category%/%postname%.html
  4. Click Update Permalink Structure.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment


Powered by WordPress