Frage

I deployed my asp.net web app to IIS and now when I go to http:\servername\mywebsite I get the directory listing page.

What would I have to configure to make the launching page be http:\servername\mywebsite/login.aspx ? Please keep in mind I am not using default.aspx or home.aspx

War es hilfreich?

Lösung

When you send a request to IIS that does not include a page name, IIS uses its list of Default Documents to see what file it should display.

As standard default.aspx will be added to this list, but if you're not using default.aspx you must add in which file you actually want to be used.

Here is a guide for setting up default documents in IIS6

And here is a guide for setting up default documents in IIS7


As far as making the launching page go to /mywebsite/login.aspx there are a number of possibilities.

If you use ASP.NET authentication, then you can setup via the web.config file to redirect to that page should a non-authenticated user go to the site.

Or you could use Url ReWrite for IIS - although I have limited experience with it, and do not know if you can write rules that take into account authentication.

Andere Tipps

You can do that by disabling the directory browsing in following way:

Open IIS Manager and navigate to the level you want to manage.

In Features View, double-click Directory Browsing.

In the Actions pane, click Enable if the Directory Browsing feature is disabled and you want to enable it. Or, click Disable if the Directory Browsing feature is enabled and you want to disable it.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top