I've been having problems making IIS7 work with a Drupal autocomplete widget and it's preventing me from using clean URLs.

The problem lies in URLs ending in spaces; I initially thought it was URLs with spaces in them, however, after more experimenting, it's only URLs ENDING in spaces that cause IIS7 to 404.

Examples:

http://www.imeasure.ca/nodereference/autocomplete/field_measurement_sheet/Hairysquid%20llama

http://www.imeasure.ca/nodereference/autocomplete/field_measurement_sheet/Hairysquid%20

No matter what you type around the %20 at the end of the path, it will return [ ]. Only when the path ends in %20 does the 404 come up. Frankly, any path at that domain ending in %20 causes an error.

I'm thinking this is due to some stupid, stupid Windows system-level function that removes trailing spaces from filenames. Like, try typing a filename ending in a space in Windows -- it's always truncated. To this end:

How would I suppress IIS 7.5 error 404 messages resulting from paths ending in %20?

Many thanks.

link|improve this question
Suggestion: create a rule to redirect such URL to the same but with no space at the end. That's if IIS Security will allow such space-ended URL reach URL Rewrite module, of course. – LazyOne Aug 24 '11 at 12:22
I'll give that a shot, but I get the feeling that will interfere with the Ajax lookup... – aendrew Aug 24 '11 at 15:19
Can you please clarify which subcode of 404 error you are having (e.g. 404.19 .. or another)? – LazyOne Aug 24 '11 at 15:34
It's not giving me a subcode; if I change the %20 to a + character (and turn double-escaping off; I've toggled it on and off, no impact to the %20 issue), I get a detailed 404.11. With a %20, I just get a "Server Error in '/' Application" -style 404. It seems that adding %20 to the end of URLs confuses IIS as to which site is being displayed or something... – aendrew Aug 24 '11 at 18:00
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.