Skip to content

Commit

Permalink
Replaced malfunctioning web.config example
Browse files Browse the repository at this point in the history
I followed the instructions on http://book.cakephp.org/2.0/en/installation/advanced-installation.html#url-rewrites-on-iis7-windows-hosts and even tried some other proposed solutions found on Google which all didn't work.
Then I was pointed to this lighthouse ticket http://cakephp.lighthouseapp.com/projects/43067/tickets/113-creating-webconfig-file-in-windows-for-ii7#ticket-113-5 where user Lee Chenhwa pointed out that he got it working with the solution proposed in the Stack Overflow question http://stackoverflow.com/questions/12497904/htaccess-and-cakephp-2-on-windows-iis7 created by the ticket creator. This working solution is an improved (read more flexible solution of the also solution http://www2.palomar.edu/pages/sphillips/cakephp-with-iis-7-rewrite-rules-in-a-sub-folder/ which was found in the mean time by the ticket creator.
I tested this solution on my Windows 2008 R2 with IIS 7.5 and it works. Even renamed my cakephp installation (which confirms the improved flexibility).
  • Loading branch information
ravage84 committed Feb 1, 2013
1 parent 22eceba commit bc5de52
Showing 1 changed file with 25 additions and 23 deletions.
48 changes: 25 additions & 23 deletions en/installation/advanced-installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,33 +261,35 @@ these steps:
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<clear/>
<rule name="Imported Rule 0" stopProcessing="true">
<match url="^(img|css|files|js)(.*)$"></match>
<action type="Rewrite" url="app/webroot/{R:1}{R:2}" appendQueryString="false"></action>
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="/" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<action type="Rewrite" url="/{R:1}" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="app/webroot/" />
</rule>
<rule name="Imported Rule 3" stopProcessing="true">
<match url="(.*)" ignoreCase="false" />
<action type="Rewrite" url="app/webroot/{R:1}" />
</rule>
<rule name="Imported Rule 4" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:1}" appendQueryString="true" />
</rule>
</conditions>
<action type="Rewrite" url="index.php?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
Expand Down

0 comments on commit bc5de52

Please sign in to comment.