简体   繁体   中英

Anyone get CakePHP 2 to work on IIS 5.1 with Helicon ISAPI_rewrite?

I'm trying to get CakePHP 2.0 to work on my Win2k laptop at home but have been stymied by mod rewrite issues. For previous versions of Cake (1.2, 1.3) I used ISAPI_rewrite with the following rule (my app is in a virtual folder 'cake'):

RewriteEngine on
RewriteBase /cake
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

However this doesn't seem to work on CakePHP 2.0. If I enter the base directory 'localhost/cake/' I get the standard Cake welcome screen (tmp dir status, etc...) and it says everything is configured correctly. If I type in 'localhost/cake/widgets/index' it churns a bit and then just goes back to the standard screen that says everything is OK. No errors, nada.

This isn't the first time I've had problems with IIS, but I'm stuck with this laptop for a while longer. Any help would be appreciated.

as I already answered here: http://groups.google.com/group/cake-php/browse_thread/thread/c266c5227b16dab7

it should read:

index.php?/$1

This worked for me:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>

                <rule name="Redirect plugin resources" stopProcessing="true">
                  <match url="^(.*)/(ico|img|css|files|js)(.*)$" />
                  <action type="Rewrite" url="app/plugin/{R:1}/webroot/{R:2}{R:3}" appendQueryString="false" />
                </rule>
                <rule name="Redirect static resources" stopProcessing="true">
                  <match url="^(ico|img|css|files|js)(.*)$" />
                  <action type="Rewrite" url="app/webroot/{R:1}{R:2}" appendQueryString="false" />
                </rule>

            </rules>
        </rewrite>
    </system.webServer>
</configuration>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM