IIS & Invalid Folder Names

Recently at work, I was working on cleaning up some of the pages which are used to view the statistics of various domains. One in particular is the branded domain that is used for marketing purposes, while the actual content for the site resides at sub-domains.

For the sake of discussion, lets assume the branded domain is www.domain.com, while each of the sub-domains are broken down by year; yyyy.domain.com.

The existing structure of the statistics, only allowed for a single years worth of statistics to be stored (logically speaking). Under the document root, there were simply a bunch of folders representing the current month and previous months that had elapsed.

Doing the logical thing, I created folders named yyyy.domain.com with sub-folders named by monty with a yy suffix on them. After spending considerable time collating all of the statistics for the domain (there are tens of gigabytes of log files), it was finally complete.

As I went to view the statistics, I was greeted with a rather strange error message from IIS:

  1. HTTP 403.1 Forbidden: Execute Access Forbidden

You would normally interpret that sort of an error as a permission problem. For instance, you were running some sort of script/cgi and the virtual host had no execute permissions. Well after checking the vhost information, script execution was turned on. So for the sake of testing, I increased it to scripts and executables. Still nothing, I was beginning to wonder what was going on. I then checked the permissions on all the folders I had created (I created them over the network, thought maybe the right rwx permissions hadn’t come across), nope.. they were fine too.

After a couple of hours of head scratching and googling, still nothing. There were thousands of pages relating to actual cgi/script/executable problems, however mine was plain static HTML.

The problem: I named my folders yyyy.domain.com. For some reason, IIS considers a folder with dots/periods in them to be invalid.

The solution: remove the dots in the sub-folders and replace them with underscoress (_). Bing, worked like a charm.

5 thoughts on “IIS & Invalid Folder Names

  1. Hello, I had this exact same problem but discovered something else about it you might want to know. I think the error is only particular to folders named .com – not folders with just a dot in them. To test, try renaming the folder http://www.whatever.bom (or .dot anything) and it will probably work, but change it back to .com and it will stop again. Odd.

  2. Well that is a very interesting fact that I’m going to have to check on.
    Thank you for the heads up.


  3. The problem reproduces if you use PHP and IIS when, for example, you have a folder named “scripts.php”. It won’t work. Renamed to “scripts.pho” works :(

  4. Was trolling your old posts Al, and noticed a (fairly) recent comment…

    Its a case of better safe than sorry. IIS doesnt check that a URL is in fact a folder name, but rather blocks the executable extension directly, which makes a little sense.

    .com, .exe, .whatever extensions are executable will cause URLs to bork.

    I much prefer that sort of blanket ban, since there’s no “executable” file attribute under windows. Certainly saves confusion with.. say… a malware.com file existing in a folder which also contains a subfolder called ./malware.com

Comments are closed.