Running Cake Under IIs (5 or 6)

Getting Cake working under IIs was a time-consuming task of trial and error. Admittedly, it was more of the later but with some generous help from Gwoo, i am now running, in production, several apps built on various versions of cake...and you can too.

The first step is finding something akin to Apache’s mod_rewrite...i tried several that are availible through a Google search but, most of the ones in my price range (read Free) were a bit lackluster...or at least i couldnt manage to get them functioning. One though, availible here: http://www.isapirewrite.com/ worked swimmingly and is very easy to set up. I use the free, lite version which only allows one configuration for all your sites but i havent found the need to have more than one so far...

To set it up all you really need to do is put it somewhere, set the config, and then point your site at it in IIs. Ill leave the putting it part to you but i will offer you my config settings to get you off and running fast. My httpd.ini file looks like this:

[ISAPI_Rewrite]

RewriteRule (.*?\.php)(\?[^/]*)?/([^/]*)/(.*) $1(?2$2&:\?url=/$3/$4) [L]

RewriteCond URL .*\..* [O] RewriteRule (.*) $1 [L]

RewriteRule ^/(.*)/ /index.php?url=/$1 [L]

RewriteRule ^/(.*) /index.php?url=/$1 [L]

Anyway, after that is set....go to your site definition in IIs and go to ‘properties’...flip over to the ISAPI Filters tab and add a new one...you can put whatever you’d like under ‘Filter Name’ but where is says ‘Executable’ you need to browse and point at the ISAPI_Rewrite.dll file wherever you put it earlier. after clicking ok i think you may need to restart IIs and then boom! ready to bake.

 
tutorials/cake_under_iis.txt · Last modified: 2006/11/20 03:39 by ieatfood