Make my urls purty!
November 25, 2008 4:01 PM Subscribe
What's the best way for me to create human-readable urls for a Wordpress site?
posted by drjimmy11 to computers & internet (11 answers total) 7 users marked this as a favorite
So I've taken a job converting a very static site to one that will use Wordpress as a CMS. A couple of key points up front:
1) We are 100% committed to using Wordpress. Thanks for respecting this.
2) I will NOT be making use of any wordpress theme or allowing users to go to any Wordpress pages at all. We are using it as a CMS on the backend, and on the frontend I will write custom php pages and queries to display what i want to display.
The site as it stands now has 1000s of articles in totally flat html pages. We want to get away from that for obvious reasons. My inclination is to create one page to use over and over again, so where the old url would've been like:
the new url would look like:
two issues with this:
1) the site is quite popular, so a lot of people have probably bookmarked old articles and I dont want those links to die when we remove all the flat html pages.
2) I would prefer people to see human-readable urls rather than ugly querystrings.
My first instinct would be to create a big redirect file (301), sending every old article url to the new format. This addresses point one but not point two, since after the redirect the user would still see the ugly url, right? (if not, please enlighten me!)
My other thought is to use the "ugly" article.php as an include inside a wrapper, so create "article_name.php" which contains nothing but a variable for the article id and a copy of the include which takes in that variable. problems with this are a) we still clutter up our server with 1000s of files, and b) I have non-tech people messing with code and ftp, which i'd rather not.
So, what is the solution? How does mefi get those awesome clean urls like "http://ask.metafilter.com/107722/Batch-Adding-Text-File-Name-to-JPEG-Images"?
I'm guessing "107722" and "Batch-Adding-Text-File-Name-to-JPEG-Images" are some sort of aliases and not literal folders on the server. Is this something automated that is beyond the power of Wordpress? I hope not.