|
|||
|
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 |
|
|||
|
I tried setting an environment variable from the RewriteRule line in .htaccess as follows but it didn't seem to help and after the first load or two seems to have caused a 500 error (not quite sure why)...
RewriteRule !\.(js|ico|gif|jpg|png|css|pdf)$ index.php [E=REQUEST_URI:%{SCRIPT_URL}] |
|
|||
|
Quote:
Or just list all the server environment variables. They will be different depending on your htaccess configuration. Turn htaccess on again, and check again. If you never see a REQUEST_URI your hosting provider should be able to tell you why. It might be the way that virtual hosting is configured. A 500 error is pretty general. You'll see it a lot if your htaccess is configured improperly. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|