[wp-hackers] URL to jump to the single post of a day

Mike Schinkel mikeschinkel at newclarity.net
Sat Feb 14 21:59:28 GMT 2009


Do you want /a to work for every post, or do you want /{x} where "x" is the first character of the slug?

-Mike Schinkel
http://mikeschinkel.com/

----- Original Message -----
From: jidanni at jidanni.org
To: wp-hackers at lists.automattic.com
Sent: Saturday, February 14, 2009 12:41:20 AM GMT -05:00 US/Canada Eastern
Subject: [wp-hackers] URL to jump to the single post of a day

While converting a static HTML site to WordPress, I have fifty URLs to
redirect via .htaccess. I should probably just hardwire them all in,
but I noticed for WordPress if there is only one match for day, etc,
the name gets expanded:
$ HEAD -Sd http://localhost/articles/index.php/2002/10/02/a
HEAD http://localhost/articles/index.php/2002/10/02/a --> 301 Moved Permanently
HEAD http://localhost/articles/index.php/2002/10/02/a-government-out-of-control --> 200 OK
So I was thinking maybe instead of 50 hardwired lines, I could just
get away with one:
RedirectMatch (articles)/(\d{4})(\d{2})(\d{2})\.html$ http://localhost/$1/index.php/$2/$3/$4
which gets to the archive for that day, good enough, but as my site
never had more than one article per day, I am looking for the magic
wildcard character I could add to the end to jump straight to the article.
I could add "/a", but not all my articles start with "a". OK, never
mind. I'll just hardwire them all in. That way I can just issue the
definite 301 redirect in one shot.
_______________________________________________
wp-hackers mailing list
wp-hackers at lists.automattic.com
http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list