MetaFilter is turning ten! Help us celebrate at one of dozens of meetups.



Advertise here: Contact FM.


Help me redirect my old URLs
February 13, 2008 3:50 PM   RSS feed for this thread Subscribe

Help me redirect my old URLs.

So we switched sites. The old URL structure was:

http://www.domain.com/media/paper143/news/2005/03/22/OutAndAbout/My.Old.South.Philly.Home-899896.shtml

The new one is http://domain.com/2005/03/22/My-Old-South-Philly-Home

What is the easiest way to redirect the old to the new? Is there any way?(the old url is from an old CMS the new one is Wordpress)
posted by Blandanomics to technology (4 comments total) 3 users marked this as a favorite
Here's a Wordpress plugin. I have not used it tho.
posted by loiseau at 4:00 PM on February 13, 2008 [1 favorite]


If that wordpress plugin doesn't work out for you, you might have to create your own rules using ModRewrite. Make sure your host supports Modrewrite and your .htaccess is enabled.

Note: there are probably already rules enabled to allow the clean urls provided by wordpress in the first place, you might just have to add some new ones.
posted by puddpunk at 4:25 PM on February 13, 2008


Mod-rewrite is your friend.

The regular expression to rewrite is going to be something like the following (untested and perl regular expression syntax so probably wrong for mod_rewrite):

from:

http://www.domain.com/media/paper143/news/(\d{4}/\d{2}/\d{1,2})/OutAndAbout/(\w|\.)-\d+.shtml

to:

http://www.domain.com/$1/$2

note you need an extra bit of logic to translate the dots in the first version of the end of the url ($2) to dashes in the new version.

Anyway that's a start with mod_rewrite.
posted by singingfish at 4:34 PM on February 13, 2008


How about a 301 redirect?
posted by Taken Outtacontext at 10:12 AM on February 14, 2008


« Older Name the movie based on the on...   |   I bought an interesting painti... Newer »
This thread is closed to new comments.


Related Questions
How do I make Firefox go to a page that I choose... February 19, 2009
URL rewrite in IIS7: make foo.com/bah/ redirect to... February 10, 2009
Digital Immunodeficiency Disorder? January 25, 2009
Make my urls purty! November 25, 2008
Why is my computer taking me where I don't want to... May 2, 2008