How do I redirect a directory's default file with IIS7?
10,124
If you create default.aspx and redirect it to another page, the other pages should still work.
In IIS Manager, right click the default.aspx page, select properties, select the radio button for A redirection to a URL. Enter the redirection URL and click OK.
In IIS 7, drill down to the page in Content view, then when you click the page select Switch to Features View and select HTTP redirect.
Author by
Jeff
Interested in .NET, ASP.NET, C#, VB, (X)HTML, CSS, JavaScript, bjj, snowboarding, mountain biking and Jesus.
Updated on September 18, 2022Comments
-
Jeff over 1 year
I want the default document in a folder to redirect to another URL but I still want other files in the same directory to be served normally. How can I do this in IIS 7? For example:
my-site.com/ => redirects to http://example.com my-site.com/default.aspx => redirects to http://example.com my-site.com/foo.aspx => served normally
-
Jeff about 12 yearsAre these instructions for IIS 7? I don't see
Properties
when I go into Content View and right click the file. -
uSlackr about 12 yearsedited my answer
-
Jeff about 12 yearsOh, ok. That makes sense. I tried that and IIS is redirecting for
/default.aspx
but not/
. Is it supposed to redirect for both? -
uSlackr about 12 yearsif you redirect / I believe it will not allow you to get inside the directory. The default file should be sufficient.