The general problem:
We have urls coming to our IIS web servers formatted like:
We are also seeing that urls like this are coming in:
We would like to get rid of that extra path character because when the user agent is Internet Explorer, this is resolving as 2 different pages, and thus, downloading the content twice when it should be resolved from a cache.
I am not sure if this is a problem to be solved with something like a url-rewriting module, or if there is a configuration setting.
I think the problem’s with IE and not IIS.
Url Rewriting usually refers to the process of mapping a URL from
http://example/shoes/clarkestohttp://example/shoes.aspx?maker=clarkeson the server so that the browser doesn’t know about it.What you need to do is Redirect the browser from
http://www.server.com//page.aspxtohttp://www.server.com/page.aspxusing a 301 Http response code.In theory:
As you seem to be using ASP.NET, the most transparent way to do this would be to write a HttpModule that checks for double slashes in the requested URI and does the redirect.
The easiest way to do it is to put some code in Global.ascx.(cs|vb) to check the requested URI on BeginRequest.
Either way, the code to do the checking would be the same.
In Practise:
It might be that IIS or ASP.NET swallows up the double ‘/’ before you get the chance to see it. If it’s IIS then you might have to use a proxy in front of IIS. If it’s ASP.NET then you might be able to find an ISAPI Extension that will do the job for you.
Other Options
You could either