I'm not sure if this is the solution for your problem. But if you are stuck,
this maybe worth a try.
It worked!! Thanks!
Jim Scherer wrote:
Hi,
I'm a Dreamhost hosting user and I am having routing problems too. I've
hacked Zend_Controller_Request_Http public function setRequestUri to resolve
my issue and have posted a question about it here
http://www.nabble.com/Zend_Controller_Request_Http-setRequestUri-bug--tf3953464s16154.html
My hack is to flip the 1st and 2nd elseif condition so that
$_SERVER['REDIRECT_URI'] is checked before $_SERVER['REDIRECT_URL'].
public function setRequestUri($requestUri = null)
{
if ($requestUri === null) {
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) { // check this first
so IIS will catch
$requestUri = $_SERVER['HTTP_X_REWRITE_URL'];
==> } elseif (isset($_SERVER['REQUEST_URI'])) {
==> $requestUri = $_SERVER['REQUEST_URI'];
==> } elseif (isset($_SERVER['REDIRECT_URL'])) { // Check if using
mod_rewrite
==> $requestUri = $_SERVER['REDIRECT_URL'];
} elseif (isset($_SERVER['ORIG_PATH_INFO'])) { // IIS 5.0, PHP
as CGI
$requestUri = $_SERVER['ORIG_PATH_INFO'];
if (!empty($_SERVER['QUERY_STRING'])) {
$requestUri .= '?' . $_SERVER['QUERY_STRING'];
}
} else {
return $this;
}
} elseif (!is_string($requestUri)) {
return $this;
} else {
// Set GET items, if available
$_GET = array();
if (false !== ($pos = strpos($requestUri, '?'))) {
// Get key => value pairs and set $_GET
$query = substr($requestUri, $pos + 1);
parse_str($query, $vars);
$_GET = $vars;
}
}
$this->_requestUri = $requestUri;
return $this;
}
I'm not sure if this is the solution for your problem. But if you are stuck,
this maybe worth a try.
Jim
alesl wrote:
Hi.
When testing a Zend Framework application at Dreamhost hosting, I
discovered a problem with the routing system in my particular
configuration.
At home everything works perfectly (tested on windows and linux -
apache_mod), but routing does not work correctly in environmet with
Apache, suexec and mod_rewrite (Dreamhost).
This is my .htaccess
RewriteEngine on
RewriteBase /
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*\.)(js|css)$ index.php [L,NC]
The second conditon rewrites js and css files to index.php where front
controller takes action with defined route:
routes.jscss.type =
"Zend_Controller_Router_Route_Regex"
routes.jscss.route = "(.+)\.(css|js)"
routes.jscss.defaults.module = "jscss"
routes.jscss.defaults.controller = "index"
routes.jscss.defaults.action = "index"
routes.jscss.map.1 = "file"
routes.jscss.map.2 = "type"
Ass i said on local machines js, css files are minimized and send back to
browser. On Dreamhost nothing hapens -> routing is ignored ?!?!
Any sugestions??
Regards, AlesL