Sunday, April 17, 2011

Subdomain to point to subdirectory of main site?

I have my website running at:

I also have this other domain:

Is it possible to point "" to a subdirectory of ""? For example:>


It's not just a redirect, I need to serve the pages and see "" in the user's browser.

What do you think?

We use IIS7 and everything is ASP.NET (aspx pages, ascx controls, etc).

From stackoverflow
  • You're looking at two methods for this:

    • URL rewriter
    • Server.Execute method

    The first is a httpmodule that silently redirects the request without changing the url in the address bar, the second is a method you can call within aspx code. I think the latter is only good though if you're working in the same application, so I would go with the URL rewriter.

    There is an official iis7 URL rewriter available on afaik.


    x0n : dude, rtfm. I gave you enough to get started :)
  • Using ISAPI Rewrite

    RewriteCond  Host:  (?:www\.)?other\.com
    RewriteRule  (.*)$1 [I,L]
    vartec : Well, actually you're in luck. IIS7 does indeed provide similar functionality.
  • Two questions for you:

    1. Can you set them up as two different web sites in IIS?
    2. If someone visited, would that be the same as

    If the answer is yes to both of those, why not just setup a new web site in IIS and point it to the "other" file path.

    Micky McQuade : good would not inherit the config files. There would need to be some in the "other" directory.


Post a Comment