IIS7: Mapping script handlers
There are instances when you may want to force a script handler onto a file with a different extension when web-hosting - or more usefully, with no extension at all.
The main reason you'd want to do this is so you can have what effectively looks like a long URL of directories, when actually they're directives for a script - and save having to use all those nasty search-engine unfriendly GET ?arguments...
To do this in Apache is easy, you just add or update your ".htaccess" file to include something to the effect of:
ForceType application/x-httpd-php DirectoryIndex myroot
This will make the file called "myroot" (with no extension) run in the same way as any .php file would. The last line makes it the default file for the directory.
In IIS7 you can do a similar thing, but being IIS it requires clicking about.
First open the "Handler Mappings" page, search through for your existing handler, e.g. "*.php" and edit it so you can copy the executable path.
Secondly create a new Module Mapping and add your new magic file into the Request Path box. Select the Module type as per your existing entry (probably FastCgiModule), and add in the executable path.
If you have spaces in the executable path ensure you wrap them in quotes (even though the original didn't show any quotes).
e.g. "C:\Program Files (x86)\PHP\php-cgi.exe"
Thirdly you need to go into the Default Document page and add your new file name in at the top of the list.
Job done.