Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IIS Web application adding return URL

Posted on 2014-03-17
8
Medium Priority
?
1,500 Views
Last Modified: 2014-03-23
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
0
Comment
Question by:Angel02
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 1400 total points
ID: 39936060
You are using Forms authentication, and when your user hasn't logged in, then they are directed to the login page by default, regardless of what page they were trying to originally access. ASP.NET will append the original page that the user was trying to access to the URL as the ReturnUrl, and once the user logins in, he will be redirected to the page they were previously trying to access.

If your actual login page is named weblogin.aspx, then you need to change the value in the loginUrl property (line 2 of your attached file).
0
 

Author Comment

by:Angel02
ID: 39936713
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?
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 600 total points
ID: 39936768
If you put WebLogin.aspx as the login page in the Forms tag, user will get redirected to this page automatically and you don't have to worry about default documents.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39936820
"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.
0
 

Author Comment

by:Angel02
ID: 39936925
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?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39940096
So it is working really. Now you have another problem.

What does weblogin.aspx contain?
0
 

Author Comment

by:Angel02
ID: 39942644
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?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39948877
Can't think of if it is working.
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question