2021-02-20
Maintaining old URLs with parameters
In looking for something different I noticed requests for old urls for rss.php urls on a site. But that site was rewritten in a different programming language and I use a generic .cgi extension. I had to look up how to do redirects with paramaters again because a RewriteRule directive in apache normally only uses the url, not the parameters. The page Redirecting and Remapping with mod_rewrite - Apache HTTP Server Version 2.4 gave me some hints, and I ended with:RewriteCond "%{QUERY_STRING}" "(.+)" RewriteRule "^/rss.php" /rss.cgi?%1 [R]Which does exactly what I want.