My Hackergotchi

Updated: Never — Philip's Blog

Now featuring regular updates!

Mon, 26 Nov 2007

01:08 – Fun with mod_rewrite

Instead of hacking pyBlosxom, I just used mod_rewrite and tcsh:

[261] (philip@dorfl)~% set new = 'http://www.paeps.cx/weblog/travel/$1'
[262] (philip@dorfl)~% foreach file ( `find $home/weblog/travel/ -type f` )
foreach> printf 'RewriteRule ^weblog/life/(%s.*) %s [R=301]\n' $file:r:t $new >> $home/www/.htaccess
foreach> end

I'm sure I could write a script to magically deal with every 404 in /life by checking if it exists in /travel but... I'm lazy and this Just Works[tm].

Name:

Email:

URL:

Comment:


Prove that you are not a spammer: