mod_rewrite URL conversion Mar26 '05
I spent the better half of the day trying to understand Apache’s mod_rewrite directive, to help convert my permalinks over to a better format.
My current permalinks look like this:
http://www.matthom.com/archive/2005/03/26/01/
The 01 at the end changes to 02, 03, etc – for however many entries there are for that day.
This is a partially poor URI.
It’s descriptive, with the dates, but the number at the end means absolutely nothing to the naked eye (and search engines, etc).
I’d like to have my permalinks appear as such:
Just by looking at it, you can ascertain extremely useful information. The year, month, day, and condensed title of entry.
I know how to make my URI’s appear like that. The problem is... having the old permalinks map to the new permalinks.
One solution is to use this line in my .htaccess file:
Of course, the code above would all be on one line.
This is sufficient, but only for that specific URI!
What about the other 480 blog entries that I have? I’d have to write a rule for each one.
This is absurd.
I need some way of having my Redirect rule change according to whatever the entry request is. In other words, a dynamic redirect.
Still looking for the answer...
Categories: Apache ![]()
Add Feedback (view all)
Leave feedback
matthom
is published and produced by Matt Thommes - an independent publishing enthusiast, mobile blogger, content creator, informative writer, web developer from Chicago.
Never one to conform, Matt intends to promote the effect the web has on our lives, in an effort to intensify, instruct, and clarify all that is happening around us.
Similar Entries
- Accessible URL’s make life easier (75 recent visits)
- PHP: Skipping index page call in URL (200 recent visits)
- W3C on relative URL references in feeds (3 recent visits)
- Friendly URL’s at Amazon (10 recent visits)
- Flickr friendly URL’s (108 recent visits)
- Passing decimals in the URL (2 recent visits)
Stats
9 unique visits since December 2008
I had the same problem when I changed over to my new permalink model. My old one looked something like this: http://blog.dalegroup.net ... Read more.