Link to home
Start Free TrialLog in
Avatar of Angel02
Angel02

asked on

IIS Web application adding return URL

When I copied my .NET web application folder to IIS and added it as a virtual directory, it opened like a charm http://mywebserver/mywebapp.
I then hit publish from my development machine and published on the webserver directly. This was the first time I was doing it and something got messed up.

Now I try to access the web application and it goes to

http://mywebserver/mywebapp/Account/Login.aspx?ReturnUrl=%2fmywebapp

It looks like it is because of the web.config. But this issue did not come up previously with the same web.config. My default page should be weblogin.aspx. I have added it on the top of list of default documents in IIS.
Anyway, I tried changing a lot of things but the application does not load as needed. Can someone please take me in the right direction?
EE-webconfig.txt
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Angel02
Angel02

ASKER

Thanks. Can I remove the entire forms authentication tag? Do I also need to add the default document tag
 <defaultDocument>
<files>
       <!--<add value="WebLogin.aspx"/>-->
      </files>
    </defaultDocument>
Should I mention the default document here in web.Config or in the IIS. Default document lists or do not mention at all if I am using forms authentication?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
"Default document" is used for when a user does not put a particular page in the URL when coming to your site. You would not use the default document as kind of redirect to your login page--that's not its intent. It basically treats:

    http://www.example.com/

...as if the user had entered:

    http://www.example.com/index.html

...or whatever default document you specified in your configuration file or within IIS.
Avatar of Angel02

ASKER

If the user goes to http://mywebserver/mywebapp, it should be as if the user has entered http://mywebserver/mywebapp/weblogin.aspx.

I changed the forms authentication to
 <forms loginUrl="weblogin.aspx" timeout="2880"/>
and removed the default document from web.config and in IIS.

Now when I browse the web application from IIS, it keeps loading then displays the weblogin.aspx as plain text (without images and css) and then it says "localhost not responding". I can't figure out what is going on.

Is this all just because I did something when I published?
So it is working really. Now you have another problem.

What does weblogin.aspx contain?
Avatar of Angel02

ASKER

It is a simple page to enter login credentials. Only additional thing in it is it accesses a master page.
Interestingly, when I copied the project to a new location C:\WebSites\MyWebApp (Previously it was at c:\inetpub\wwwroot) and added a new virtual directory with  C:\WebSites\MyWebApp as the physical path, everything got back to normal. The website is now loading perfectly. So I am going to leave it like that.

Is there anything I need to worry about?
Can't think of if it is working.