History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-25
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Michal Minicki
Reporter: Zend Framework
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Zend_Controller_Router breaks on IIS due to differences between IIS and Apache (TRAC#2)

Created: 19/Jun/06 10:46 PM   Updated: 05/Jul/07 02:44 PM
Component/s: Zend_Controller
Affects Version/s: 0.1.3
Fix Version/s: 0.1.4

Time Tracking:
Not Specified


 Description  « Hide

Hi friends,

When I was making a test running Zend Framework on IIS Server I've stopped by a problem. After some tests I've found a bug at this line: The bug occurs because when you put http://www.xxx.com/ as your's url the apache server returns http://www.xxx.com/, but IIS returns http://www.xxx.com/index.php or your default page.

That action causes a crash at the 71th line of library\zend\controllers\route.php, where strlen($controller) now will not return 0 but 9 (if index is your default page) and 'index.php' isn't a controller, then noRouteAction will be selected, returning to index.php, this error will be again and will return to index again.... and thus successively.

sorry by disturb, and congratulations for the good job,

Bruno Eduardo de resende Oliveira



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Zend Framework - 19/Jun/06 10:46 PM
05/05/06 08:41:33: Modified by php@dayclan.org

I'm running ZF on IIS. It functions great with a small workaround. You have to install Isapi_Rewrite (http://www.isapirewrite.com/) to get mod_rewrite-like functionality in IIS. Then in Zend_Controller_Router you only need to change line 52 in Zend/Controller/Router.php from

$path = $_SERVER['REQUEST_URI'];

to

$path = strtolower($_SERVER['HTTP_X_REWRITE_URL']);

Isapi_Rewrite sets the HTTP_X_REWRITE_URL $_SERVER variable to be what REQUEST_URI would be if you were running on Apache and using mod_rewrite.

I hope that helps.
06/12/06 06:22:42: Modified by Link


Michal Minicki - 23/Jun/06 10:30 AM
Could you provide working isapi rewrite rules? I'm trying those and they don't seem to work on my setup:

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^.*$ index.php

And this also doesn't work:

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


Michal Minicki - 26/Jun/06 10:20 AM
I have found a working rewrite rule:
RewriteRule (?!\.(js|ico|gif|jpg|png|css|swf))$ index.php

Router works as expected. Without any changes to the code.