View Single Post
  #1 (permalink)  
Old 05-20-2008, 02:23 AM
jandersen78 jandersen78 is offline
Junior Member
 
Join Date: May 2008
Posts: 2
Default RedirectLoop from IndexController

Hello All,
I'm struggling to move an existing and functioning ZF app to a new host. The key problem seems to be that requests for /main/static/ which should be directed to my StaticController are always being routed to my IndexController.

I'm finding that any time I hit the app on the new host a loop of 302 redirects begins. The redirect is generated by the IndexController which routes to a view which redirects to another url in the app-- "/static/"-- which should trigger the StaticController to serve the first page in the app.

Through the use of the echo and exit functions I've discovered the the IndexController is in fact executing repeatedly and the StaticController is not executing at all. The server is running PHP 5.2.3 in CGI mode. Following is the mod_rewrite rule from .htaccess:

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

Another observation is that the $_SERVER['REQUEST_URI'] variable is empty (not listed in phpinfo()) whereas on the working host this variable returns the original request uri as expected-- "/" for the IndexController and "/static/" for the StaticController. I'm not sure if this is a function of cgi mode nor am I sure if that is the variable used by ZF to select a controller...

I'd really appreciate some help! I'm not really anxious to wade through the framework code to find exactly where the controller is selected but if someone happens to know that would be useful as well. My gut feeling is that some $_SERVER variable used by php to access the original request URL isn't set properly; I can't see anything in phpinfo() containing the original request uri! If that's the case I'm not sure how to workaround it either...

Thanks!
-James
Reply With Quote