What is IIS 6.0 with a slash after the page name in the URL?

I had a question from a client who alerted me.

They use IIS 6.0 and for some reason, instead of just asking for a page on their server, which I will call www.domain.com/Default.aspx, someone printed www.domain.com/Default.aspx/randomstuff

It seems that the IIS answer should have served Default.aspx as usual, but as far as the browser goes, the path is: www.domain.com/Default.aspx/, not www.domain.com/, and therefore all the relative paths to CSS, images, etc. fail

I looked at the traffic in Fiddler, and it seems that all these images, etc. queries such as www.domain.com/Default.aspx/images/image.gif also return the contents of Default.aspx, needless to say, not a valid image!

I do not believe that they are doing anything special with URL rewriting, but to be sure, I tried an experiment on a newly created ASP.NET web application and the results were the same.

So, why does IIS pass a URL, such as /Default.aspx/randomstuff, into the ASP.NET pipeline as a request for Default.aspx? And can it be stopped and done just to throw 404, as you expect?

+3
source share
2 answers

This is called PathInfo .

You can stop something like this:

if (!String.IsNullOrEmpty(Request.PathInfo)) throw new HttpException(404);
+3
source

Yes, that’s completely normal. Apache will do this too.

, URL /script.name/random/stuff /script.name?page=random§ion=stuff URL.

, , script.name script, random stuff . , URL- random. , , , URL-, URL-.

, 404, ?

, SLaks . , , 301 Path Info.

+2

Source: https://habr.com/ru/post/1733099/


All Articles