Click here to Skip to main content
15,616,432 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi guys, i need a url rewrite rule (IIS or Apache) that will rewrite each request from old domain to new domain.

Please note that it has to rewrite also subdomains and even query string, example bellow; ><br /> >

and not only that, it even has to keep protocol, so if there was request like this; it should be

and please, i don't want to see examples for one subdomain, etc... i have hundrests of subdomains, which are generic, so this whole rule should be dynamic, and be able to accept all kind of links, and in any kind of form, and should "simply" switch from one domain to other, keeping link structure.

one more thing, this should be a permanent redirect

thank you in advance
GregWyatt 4-Feb-11 15:13pm    
Which version of IIS would you be using?

1 solution

The first website contains 10 tips for rewriting urls. #8 is to perserve the protocol. It also will help you with perserving the query strings(which I've only done in IIS 6.0) Sorry about asking which version of IIS earlier I saw the tag was marked IIS 7 afterwards.[^]

This is just the direct link to IIS 7 redirect module that appears in the above article.[^]

This is a persons blog on how to use the IIS 7 redirect module, which I have never personal used.[^]

I hope this helps and best of luck!
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900