Hello,

I've finished project(1.2.0.6311) for a client and now i'm trying to
run it on production host(shared-server). Unfortunately after setting
all up  i'm not able to make the site working. On the development
server everything works perfectly, but the production server is giving
me some unexpected errors.

If i try to load root page i get an error that there is no webroot
action in app controller, because it's trying to load app/webroot
extracted from REQUEST_URI as controller/action. If i add a parameter
to the URL, i get expected site and results (see below).

I've made a test code which i uploaded to both servers (development
and also production), to see how the rewrite engine handles url
requests. Both are running as subdomain, php5, modRewrite working,
everything is in it's place. I use these .htaccess files:

in /

   RewriteEngine on
   RewriteBase /
   RewriteRule    ^$ app/webroot/    [L]
   RewriteRule    (.*) app/webroot/$1 [L]

in /app

   RewriteEngine on
   RewriteBase /
   RewriteRule    ^$    webroot/    [L]
   RewriteRule    (.*) webroot/$1    [L]

in /app/webroot

   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

I've run two URL requests for both servers. First withou parameters,
just to load root page, and Second with paramater so i'll be accessing
some inner page. And here are the results:


#### Without Parameter = Root page ####

+ DEVEL SERVER (http://test.binary-love.sk/)

    [DOCUMENT_ROOT] => /services/www/www.binary-love.sk
    [QUERY_STRING] =>
    [REQUEST_URI] => /
    [SCRIPT_NAME] => /app/webroot/index.php

+ PRODUCTION SERVER  (http://reality.biely-dom.sk/)

    [DOCUMENT_ROOT] => /data/web/biely-dom.sk/sub/reality
    [QUERY_STRING] =>
    [REQUEST_URI] => /app/webroot/
    [SCRIPT_NAME] => /app/webroot/index.php

#### With Parameter = Inner page ####

+ DEVEL SERVER (http://test.binary-love.sk/skuska)

    [DOCUMENT_ROOT] => /services/www/www.binary-love.sk
    [QUERY_STRING] => url=skuska
    [REQUEST_URI] => /skuska
    [SCRIPT_NAME] => /app/webroot/index.php

+ PRODUCTION SERVER (http://reality.biely-dom.sk/skuska)

    [DOCUMENT_ROOT] => /data/web/biely-dom.sk/sub/reality
    [QUERY_STRING] => url=skuska
    [REQUEST_URI] => /app/webroot/skuska
    [SCRIPT_NAME] => /app/webroot/index.php

As you can see production server is always prepending /app/webroot to
the [REQUEST_URI], which is smth that causes error described at the
beginning. I think i know the reason why it ends like this. When i
request root page, rewriteRule in /.htaccess sends me to /app/webroot.
The [REQUEST_URI] already contains /app/webroot which don't pass the
rewriteCond in /app/webroot/.htaccess, because it will treat the URL
request as directory and the rewriteRule in there is skipped. After
that dispatcher parse the [REQUEST_URI] and i'm getting my error.

Any1 knows what could cause this? or better to ask how can i get rid
of that /app/webroot prefix on production server. Must be smth with
configuration mod_rewrite or doc_root or vhost or apache i don't know.
I've deployed 3 other cakephp projects without problems, but here i'm
lost.

Thanks for advice,
d.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to