We've got a website which has been running for a few years now. One of our customers has just started having an intermittent problem. Looking at our iis6.0 logs the service works correctly when they have a user agent beginning "mozilla/4.0+" but fails when the user agent begins "mozilla/5.0+". The particular customer only started having this problem on Wednesday.

Does anyone know the browser/upgrade which changes the 4.0 to 5.0?

The actual problem caused is that an "&" in a url parameter list is being encoded as "&". Anyone seen anything similar?

We have other users sending from browsers with the 5.0+ user agent without trouble.

Sorry about the tags but don't have the rep to create new ones.

Thanks in advance, Patrick

Edit: hi Viper_sb,

It is most probably a custom script (I'm primarily a c++ developer so don't really understand). Our site services requests from other customer developed sites, this one was done in Java script as far as I know.

we're actually getting a variety of user agents (presumably depending on which of our customers customers is accessing the service), here's a few:

Mozilla/5.0+(Windows;+U;+Windows+NT+5.1;+en-US)+AppleWebKit/533.4+(KHTML,+like+Gecko)+Chrome/5.0.375.126+Safari/533.4 302 0 0

2 Answers 2


Firefox 3.x and many others do.

Can you post the full agent string that you're having problems with? As it sounds like it could be a custom script that is generating the request and pretending to be a certain agent. But is incorrectly creating the ident string. Or your check against the agent string is incorrect.

Edit: The strings you posted are being url-encoded the +'s in them should be spaces. I'm not sure where the problem is, if it's on your javascript side or in the user visiting the site.

I'm going to go out here and guess that your javascript is decoding the agent string, this shouldn't happen (unless you're going to make a url out of it or post it on your web site).


I'm guessing the + in the UA strings is because of the way IIS logs it.

Just to clarify, are you saying that you have query strings in links on the site and that some UAs are making requests for those URLs but using & instead of &?

If that's the case then the most likely cause is an exceedingly stupid bot that is spoofing its UA string. Any properly written HTML should encode the & in the URL as &. A proper browser and a sensible bot have been made correctly and know that you mean http://example.com/?a=1&b=2 when you link to /?a=1&b=2 in your source code. Taking any other href literally doesn't show issues, but taking those ones literally would show the behaviour that I think you're describing.

I get all sorts of requests for pages that don't exist where they're requested, but do exist elsewhere, and it is normally because the bot wasn't able to handle such things as base paths (not my doing - OpenCart uses them for some reason) or absolute URLs or URLs on other hosts (it takes the path part but not the host).

One good indicator tends be to running a rDNS lookup on the IP. If one or more of them resolve back to a web host then someone is running a bot/dumb script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.