#fb #tw
I’m really a bit confused right now. I want to use apache2’s mod_rewrite to link from the previous blog (powerded by locally hacked SPHPBLOG) to my new, shiny, WordPress-driven one. Therefore old links like /index.php?entry=entry120414-202918 need to be redirected to http://v2.blogdoch.net/2012/04/ …
So, what I tried was:
RewriteRule ^/index.php\?entry=entry([0-9][0-9])([0-9][0-9])([0-9][0-9])-202918 http://v2.blogdoch.net/20$1/$2/ [R,L]
Above does not fire at all. The followings does, but a bit unexpected:
RewriteRule ^/index.*[^=](.*)$ http://v2.blogdoch.net/old/$1 [R=302,L]
I call "Location: http://v2.blogdoch.net/old/?entry=entry120414-202918” unexpected on a "wget http://blogdoch.net/index.php?entry=entry120414-202918” here. WTF is going on? I’d expect “entry120414-202918“, but not everything after, and including, “?” — is my regexp foo that rusty?!
Any hints appreciated ;)

Hachja … Wie schon fast vermutet, ? ist ja ein Query, und damit augenscheinlich nicht Teil der URL.
RewriteCond %{QUERY_STRING} entry=entry([0-9][0-9])([0-9][0-9])([0-9][0-9])-...... RewriteRule ^/index\.php http://v2.blogdoch.net/20%1/%2/%3/? [R=301,L]Rennt wie hulle. Wie einfach es doch ist, wenn man mit den richtigen Schlüsselwortern guckt ;)
http://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite war dann der finale Tippgeber.