[QUESTION- Please Help] IIS throwing HTTP 404 not found but requested resource actually exists. Requested URL also changing automatically.!

Hi all,

I’m facing a really weird scenario here with my local IIS. I have hosted multiple sites in the default website in my local IIS. One of them has the login page. From the login page, I’m redirecting the user to another page that is located in another site (which is also hosted in the same IIS inside default website virtual directory).

Now in the submit button click event of my login page, after authenticating the user, I have written a “Response.Redirect(redirect_url)“. the redirect_url is being formed dynamically and given as a parameter to the Redirect method.

While debugging, the final redirect_url that is being sent as parameter to Redirect method is:

But after I try to go to the next step, I’m suddenly getting a HTTP 404 error saying that the resource doesn’t exist and I have observed that Requested URL shown in the error page is different that what was dynamically sent to the Response.Redirect(…) method. See error page screen shot below.

localhost being appended automatically

localhost being appended automatically

In the error page, the requested url shows the value as


whereas my actual requested url formed in the code is:


I’m just unable to understand why the requested url is getting changed automatically.! Also, I observe that “localhost” is being appended to the requested URL again which is not what is supposed to happen.

Thanks a lot.!

This entry was posted in .NET, ASP.NET, C#, IIS. Bookmark the permalink.

6 Responses to [QUESTION- Please Help] IIS throwing HTTP 404 not found but requested resource actually exists. Requested URL also changing automatically.!

  1. When I originally left a comment I appear to have clicked the -Notify
    me when new comments are added- checkbox and now whenever a comment
    is added I get four emails with the exact same comment.
    Is there a means you can remove me from that service? Thanks a lot!

  2. It’s awesome to pay a visit this web page and reading
    the views of all friends concerning this post,
    while I am also eager of getting know-how.

  3. Spot on with this write-up, I absolutely believe that this website needs far more attention. I’ll probably be
    back again to read more, thanks for the info!

  4. HTTP Error 404. The requested resource is not found.

  5. please do let me know real problme my site

Leave a Reply

Your email address will not be published. Required fields are marked *