Andy Evans Asked: 2010-06-09 08:21:11 +0800 CST2010-06-09 08:21:11 +0800 CST 2010-06-09 08:21:11 +0800 CST How would I redirect requests for one page to another is IIS? 772 How would I redirect requests to a URL like http://www.mydomain.com/foo.aspx to another URL like http://www.mydomain.com/bar.aspx in IIS. Can this be done in IIS 6.0 or 7.0? iis redirect 2 Answers Voted Best Answer Justin Scott 2010-06-09T08:33:37+08:002010-06-09T08:33:37+08:00 If you have an existing foo.aspx file then you can set a Location header to redirect to the new file/URL: <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","bar.aspx"); } </script> In IIS6, if the file exists, using the management snap-in, you can right-click to open the properties for the file and select to redirect to another location. In IIS7, you can use the Rewrite module to capture the request and redirect it. Dominic D 2010-06-09T08:31:43+08:002010-06-09T08:31:43+08:00 You can use URL Rewrite in IIS7.0.
If you have an existing foo.aspx file then you can set a Location header to redirect to the new file/URL:
In IIS6, if the file exists, using the management snap-in, you can right-click to open the properties for the file and select to redirect to another location.
In IIS7, you can use the Rewrite module to capture the request and redirect it.
You can use URL Rewrite in IIS7.0.