简体   繁体   中英

Url Rewrite of Host in ASP.NET on IIS 6

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.

快速又肮脏...为站点创建一个默认文档(例如,default.aspx)以重定向到/hidden/default.html

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");

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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM