Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8574107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:24:03+00:00 2026-06-11T19:24:03+00:00

We have a ASP.NET 4.0 web application upgraded from 3.5. Unfortunately when the user

  • 0

We have a ASP.NET 4.0 web application upgraded from 3.5. Unfortunately when the user tries to access the URL via http://xxx.abc.com/, the user gets /login.aspx?ReturnUrl=%2f.

I understand that this seems to be a behaviour on .NET 4.0 and IIS7. This is causing an issue with load balancer as it returns 302 status code. Some reason the
load balancer has been configured to look for http 200 status code.

Is there any way we can fix the ASP.NET 4.0 behaviour so that when user clicks on http://xxx.abc.com/, show the login.aspx without redirection?

I tried this below but did not work:

<system.webServer>
    <defaultDocument>
      <files>
        <add value="Login.aspx" />
      </files>
    </defaultDocument>
</system.webServer>

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:24:04+00:00Added an answer on June 11, 2026 at 7:24 pm

    It’s not a behavior of .NET 4 / IIS 7, it’s a behavior of forms authentication. It seems that the Authentication module gets run first, and triggers the redirect before the Default Document module gets its chance. Here’s what I would suggest as a workaround:

    • set <allow users="?" /> on the root of your website by using the location tag.
    • if the above is not possible or practical, use the URL Rewrite module instead of relying on Default Document.

    I used this rewrite rule to get login.aspx returned from the root URL with a 200 status code :

    <rewrite>
      <rules>
        <rule name="RewriteURL1" stopProcessing="true">
          <match url="" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
          </conditions>
          <action type="Rewrite" url="login.aspx" />
        </rule>
      </rules>
    </rewrite>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application which was using Asp.net MVC2 . I Upgraded it
I have an ASP .NET Web Application that queries and shows data from a
I have an ASP.NET Web Application that constantly monitors for new RSS Feed from
I have a asp.net web application that uses C#. It logs in on a
I have an ASP.NET web application the entire site is browsed over HTTPS using
I have an asp.net web application written in C# using a SQL Server 2008
We have an ASP.NET web application hosted by a web farm of many instances
I have a ASP.NET web application which has more than 100 pages. Each page
I have an ASP.NET web application and I want to be able to take
I have a asp.net web application and I'm using cache (HttpRuntime.Cache) to save some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.