views:

452

answers:

3

I know this question is overly popular, but I find nothing that addresses rewriting the host, only rewriting the path.

How could I accomplish redirecting/rewriting "http://myHost.com" to "http://myAlias.com/hidden/default.html"?

ADDED: where myAlias is just an alias of myHost.

A: 

Quick and dirty ... Create a default document for the site (default.aspx for example) to redirect to /hidden/default.html

James Conigliaro
Sorry guys, I forgot to include the alias bit.
ProfK
A: 

Along the lines of what James had mentioned with the default.aspx in your root. Then you could rewrite simply..

HttpContext.Current.RewritePath("http://myHost.com/hidden/default.html");
Quintin Robinson
A: 

You can use an ISAPI-filter in IIS, like Helicon to rewrite the document path:

http://www.isapirewrite.com/

The lite version is free


Edit: Ok, your want to redirect to another domain. I don't think that Helicon supports that.

You can try (c#):

HttpContext.Current.Response.Redirect("http://myAlias.com/hidden/default.html");
WowtaH