Hello, I am trying to do some things with mod_rewrite, but I'm not very good at it. Now I have a Rule RewriteRule ^css/video/([0-9]+)/$ /?video=$1 Code (markup): So /css/video/17/ actually uses /?video=17 But, the problem is that I want visitors using old links to be redirected to the new URL (So , do the inverse thing, if an user enters /?video=17 to be redirected to /css/video/17/ ,that actually will use /?video=17 ) Do you think is it possible to do that with Mod Rewrite? Or with PHP maybe? (I didn't know if this should be posted in PHP forum, because it may be done with PHP also, so I'll post it too there)
RewriteRule ^css/video/([0-9]+)/$ /?video=$1 [L] RewriteCond %{QUERY_STRING} ^video=([0-9]+) RewriteRule .* /css/video/%1/ [R=301,L] Code (markup): I hope that's right (and doesn't result in an infinite loop )
What was I thinking? RewriteRule ^css/video/([0-9]+)/$ /?video=$1 [L] RewriteCond %{REQUEST_URI} \?video=([0-9]+)$ RewriteRule .* /css/video/%1/ [R=301,L] Code (markup):