I have a page where I present a specific product (book, cd etc) which is like this:
http://gramma.ro/Site/DetaliiProdus.aspx?c=m1&p=1493&s1=40&s2=71
I do not understand why, sometimes, some bots try to access these details pages with urls like:
http://gramma.ro/Site/DetaliiProdus.aspx?c=m1&p=1493&s1=40&s2=71
And of course, this url开发者_Go百科 no longer can be interpreted in ASP.NET like a usual url so I cannot extract the parameters like usual (Request.QueryString
)...
Do you have any idea how this bot has scanned the site in this way? Because nowhere on my site I have urls with
&
replaced by&
Do you see a work-around? I cannot replace
&
with&
on the fly for the initial request...
Ps: Oh yes, I know that if I do url rewriting I no longer have such a problem but I cannot change at this moment all the site just because of this...
Can you see in the IIS logs what kind of bot that is? Might be an unimportant one, so you could simply ignore it.
As a relatively simple workaround, you can do a URL Rewrite like this (depending on your QueryString combinations this can be adjusted): check for
(.*)&(.*)&(.*)&(.*)
and redirect to (something like - this hasn't been tested)
{R:1}&{R:2}&{R:3}&{R:4}
If there are different numbers of QueryString parameters, you could write different rules, starting with the highest amount (or find a better rule). This can really be done without changing the whole site.
But first I'd search for other reasons why this happens.
A third way (maybe the nicest) would be to use "SEO-friendly URLs" anyway instead of visible QueryStrings. It may help with your rankings, too. Check http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx (or many other sites) for more information.
精彩评论