I've a site which can be acceded through multiple domains (ie mydomain.com, mydomain.com.ar, mydomain.net, etc). Right now I have in the IIS one site and in the properties I added each domain as a host header values (the identities of the Web Site).

All domains work great. Also I have a root in the web site which checks if its a mobile client and some other stuff which redirects to the home page in the domain that I want as "default". So if the client types mydomain.com or mydomain.net it will end in the domain I want. But when the client types mydomain.com/HomePage (or any other page) it wont access the root, so it wont be redirected and will end in the domain it type.

I am doing some changes in this server so I'd like to take advantage of this changes to fix this little annoying issue. How do you recommend to manage the multiple domain for the same site? My (very elemental) acknowledge of SEO tells me that its better to use one domain and all the others redirect (somehow) to the "main" / "default" one.

Update When I asked the question I forgot that there is not one only site (despite all my explanation), there are a bunch of sites using sub-domains, folders, etc. So it is not just one asp.net site. I need an IIS solution.

link|improve this question
feedback

1 Answer

If it is a asp.net application you can install URL Rewrite http://www.iis.net/download/urlrewrite and use the web.config file to specify the redirect

<system.webServer>
 <rewrite>
  <rules>
   <rule name="Redirect to WWW" stopProcessing="true">  
<match url=".*" />  
 <conditions>  
  <add input="{HTTP_HOST}" pattern="^domainname.com$" />  <!-- here you can use the from domain -->
 </conditions>  
 <action type="Redirect" url="http://www.newdomainname.com/{R:0}" />  
</rule> 
  </rules>
 </rewrite>
</system.webServer>

Hope this helps

link|improve this answer
thanks for your answer. I've updated my question. Sorry I forgot to add that info! – Diego Jan 4 at 16:08
You're not going to like my response - you will need to add (or update) the web.config file for each site. URL Redirect will be installed on IIS - the web.config file is just the configuration for that particular site. This make sense? – Matt Jan 5 at 9:18
I'm not sure I've followed you, but isn't there any solution at IIS level? Maybe an URLRewriter module or something similar? – Diego Jan 5 at 11:09
If you are not comfortable modifying the web.config file, the software installed an added to IIS manager which allows you to create the rules with the GUI – Matt Jan 5 at 13:22
Will try and let you know. Does it work on IIS 6? – Diego Jan 5 at 15:30
show 2 more comments
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.