301 Redirect Single Page and Append Querystring

I have a classic asp (VBScript) site that I’ve changed the name of a page on (company_details.asp to modest_clothing_company_details.asp). There is a query string that is appended to this page that displays a companies information (company_details.asp?ID_company=100). I’ve been trying to create a 301 redirect for any requests that come to company_details.asp to modest_clothing_company_details.asp and then append the querystring to the end of it, but have not been successful. Can anyone help me with this?


ASP pages? Okay, this used to be an Apache board and your question looks like a mod_rewrite question. Have a look at the tutorial linked in my signature then create code (depending upon your version of IIS) to:

  1. Match the ID_company=100 query string with a RewriteCond
  2. Match the company_details.asp {REQUEST_URI} as the regex of a RewriteRule
  3. Redirect to modest_clothing_company_details.asp and add the new query string (leave it alone if it’s still IC_company=100)