Web.config whole domain redirect

garyilm
garyilm used Ask the Experts™
on
I need to change domain names and want to do a whole name redirect with a web.config file. How do I do that.

I need http://www.olddomain.com/products.asp?id=1 to redirect to http://www.newdomain.com/products.asp?id-1

So I need to rewrite the complete url incliding parameters.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Web Ninja at large
Commented:
in IIS7+, it's better to do it in the rewrite module:

http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

for iis6 and below, a third party (free) tool will work best:

http://www.isapirewrite.com
Shaun KlineLead Software Engineer

Commented:
Web.config files do not exist in the classic ASP language. They are part of ASP.net. As Big Daddy stated above, this is better done from the server side. If your site is on IIS 6 or less, you can do it from the site properties.

Author

Commented:
I've requested that this question be deleted for the following reason:

nobody answred with the details i provided.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Big MontyWeb Ninja at large

Commented:
I offered viable solutions to your question, not sure what else you're looking for, but since there was no feedback, I assumed it had answered your question.
Big MontyWeb Ninja at large

Commented:
I offered viable solutions to your question, not sure what else you're looking for, but since there was no feedback, I assumed it had answered your question.
Big MontyWeb Ninja at large

Commented:
I recommend accepting my first answer, it covers everything s/he is looking to do

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial