[typo] Permalink Structure
mike at uwmike.com
Thu Dec 1 19:47:32 EST 2005
I was moving from a hand-rolled blogging system to Typo. Because of my
Ruby inexperience, I did my permalinks using a simple PHP redirect. I
recommend this approach. Basically, you want a single RewriteRule in
your .htaccess file, which will funnel the old requests into a PHP file.
The PHP file will then access the database, look up the date, and
construct the correct "new" link, and forward the browser there.
To see it in action, try hitting
http://uwmike.com/archive/proper-forwarding and you can see that you end
up redirected to the MT/Typo-style permalink:
Your htaccess rule would be like this:
RewriteRule ^([0-9]+)/(.*)/?$ /redirect.php?id=$1&name=$2 [QSA,L]
If you'd like the PHP source of the redirection file, just drop me a
line off-list. (or, perhaps one of the gurus here can share the Railsy
way to do it that doesn't break on upgrades...)
facedown at mac.com wrote:
>I've setup a test install of Typo, imported everything from WP, and
>have it ready to go except for one thing. On my WP blog, I'm using
>the following permalink structure:
>I don't want to break incoming links and need to find a way to keep
>old links working in order to go live with the Typo install. I've
>found config/routes.rb and assume I might be able to set something in
>there to route visitors correctly, but don't know how to go about it.
>I really don't care about the final structure. IOW, if it's easier to
>keep the Typo install using the articles/year/mo/day/post_name/
>structure while redirecting those who come in on the old links,
>that's okay. I'm not too concerned about links to category or date
>archives—only links to individual articles.
>I appreciate any help you can offer. I've spent much of this
>afternoon searching the Typo site, reading through the list archives,
>and searching Google, but don't know that I've hit on the right
>keywords, yet. If this has been written about elsewhere, I would
>appreciate the link.
>Typo-list mailing list
>Typo-list at rubyforge.org
More information about the Typo-list