I lately moved from the asp.internet host to some PHP host. I'm attempting to setup 301 redirects of my old web addresses using .htaccess. Here's what I wish to accomplish:

old url: http://www.vasanth.in/downloads/download.aspx?file=file.zip
new url: http://www.vasanth.in/downloads/download.php?f=file.zip

I attempted the next:

RedirectMatch 301 /downloads/download.aspx\?file=(.*)$ http://www.vasanth.in/downloads/download.php\?f=$1

This doesn't appear to operate? What shall we be held doing wrong?

Use mod_rewrite, something similar to this:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^file=(.+)$
RewriteRule ^(.+)\.aspx$ $1.php?f=%1