[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:

http://localhost/CP/web/console/console.aspx?sk=3e3cc1a8-73c4-4945-b3f8-08af22ea4324.50008
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

http://localhost/CP/web/console/localhost/CPLogin?err=5

whereas my actual requested url formed in the code is:

http://localhost/CP/web/console/console.aspx?sk=3e3cc1a8-73c4-4945-b3f8-08af22ea4324.50008

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.!

Advertisements

About Amogh Natu

Technology enthusiast, Associate Consultant @ Microsoft, music lover, love my guitar, Microsoft.NET, ASP.NET, C#.NET Professional.
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

Your comments or opinions.....

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s