Too sober for mod_rewrite?

#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

So, what I tried was:

RewriteRule     ^/index.php\?entry=entry([0-9][0-9])([0-9][0-9])([0-9][0-9])-202918$1/$2/ [R,L]

Above does not fire at all. The followings does, but a bit unexpected:

RewriteRule     ^/index.*[^=](.*)$$1 [R=302,L]

I call "Location:” unexpected on a "wget” 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 ;)

One thought on “Too sober for mod_rewrite?

  1. 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   [R=301,L]

    Rennt wie hulle. Wie einfach es doch ist, wenn man mit den richtigen Schlüsselwortern guckt ;) war dann der finale Tippgeber.

Comments are closed.