Bruce mentioned that IIS didn't appear to support the use of commas in filenames when configuring redirects in IIS.

This is true. When you configure a redirect in IIS the data is stored in field of type string. However IIS actually stores several pieces of data in this one field, and separates those bits of data using commas. The bits of data include what URL the user should be redirected to, and whether this is a permanent redirect or not

A sample node from the IIS metabase looks like this:


If the URL you are redirecting to contains commas, then any part of the URL following the comma is ignored.

So how can we get around this? We can encode the comma. The HTTP encoded value for a comma is %2C. Instead of entering your target URL with commas, use %2C instead. How do we know to use %2C? Well the ASCII value for a comma is 44, and the Hex value for 44 is 2C. How do we know what the ACSII value for a comma is? The following code VBscript snippet will tell you:

WScript.Echo Asc(",")

To generate a table of all ASCII and corresponding hex values for common characters, you can use the following script (it's best to run at a command line using cscript.exe scriptname.vbs)

For i = 20 to 255
   WScript.Echo Chr(i) & " = " & i & " = " & Hex(i)