1
votes

I have a website developed in ASP.NET. I have it hosted in IIS and say the url is www.web.com. Whenever I request for this page by typing the URL in the browser I am redirected to the login page with URL like this www.web.com/Login.aspx?ReturnUrl=%2f.

I have added the following in web.config so as to make Default.aspx as my Default page.

<defaultDocument>
  <files>
    <clear/>
    <add value="Default.aspx"/>
  </files>
</defaultDocument>

Also,

<forms loginUrl="Login.aspx" defaultUrl="~/Default.aspx">

The pages are present on root folder, so I tried few things already mentioned here. Is there anything else I am missing ? A direction towards a solution or any links would be helpful.

Edit: The website redirects to Default.aspx when run on localhost

1

1 Answers

1
votes

A couple of minor differences, but may help. I also assume you are using IIS 7 or higher.

If they are at the same folder level, you can try:

<forms loginUrl="Logon.aspx"  defaultUrl="Default.aspx"/>

You can try:

<defaultDocument enabled="true">
  <files>
    <clear/>
    <add value="Default.aspx"/>
  </files>
</defaultDocument>