The Naked Green

2005.5.10 Tuesday

Multiple Permalink Structures

Filed under: Blog Publishing — Mr. Green @ 9.10 am

I just found out that it is possible to create multiple “Permalink Structures” in WordPress! This is great if you want to change the structure (i.e. /2005/05/10/multiple-permalink-structures.html), but already have people linking to your articles using the old structure (i.e. /archives/2005/05/10/129/). It’s also good if you have an existing site with a certain structure you want to match as well as making a new custom structure. Here’s how I did it:

  1. Make a copy of your .htaccess file located in the root directory of your blog.
  2. Log in to your blog’s admin area and go to Options > Permalinks.
  3. Change the Permalink Structure to your fancy using Permalink tags.
    • In WordPress 1.2.2 and below, you will need to open up the .htaccess file and manually add the rules
  4. Open your backup and new .htaccess files.
  5. This is the tricky part: Determining what part of your backup to copy to your new file. You may copy all of it, but it isn’t necessary.
    1. Compare and find what lines of code are different (they will look something like this: RewriteRule ^archives/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/([0-9]+)/trackback/?$ /index.php?year=$1&monthnum=$2&day=$3&p=$4&tb=1 [QSA,L]). You probably wont need to change the /archives/date/, /archives/author/, /archives/categories/ or any lines above those.
    2. copy all needed lines of code from your backup to your new .htaccess file making sure to keep it below # BEGIN WordPress and above # END WordPress.

That’s it, have fun!

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Bot-Check

Powered by WORDPRESS