简体   繁体   中英

Zend Framework on IIS6 with ISAPI Rewrite

I'm trying to move a zend application from Apache2 to IIS6, so I decided to install ISAPI Rewrite 3 as recommended here , so I copied the hole app folder to c:\inetpub\wwwroot\ and made the IIS Default Web Site to point to the folder /public.

Now, my .htaccess in /public is the following, as suggestedhere .

RewriteRule (?!\.(js|ico|gif|jpg|png|css|swf))$ index.php

But nothing happens, I can reach the homepage OK, and static files too, but no rewriting is done to my URLs, so none of my controllers would work.. Any idea? Thanks!

If you are using ISAPI_Rewrite 3 then you will need to use Apache version of rules since it is compatible with Apache, ie

RewriteEngine on
RewriteBase /
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ index.php

or better

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php

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