Re: "webroot" getting appended in subsequent links?

2007-07-06 Thread AD7six



On Jul 6, 10:13 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> hello all,
>
> I have a similar issue
>
> I'm on a shared host
>
> my setup is as follow
>
> /cake
> /httpdocs (dir accessible by browser)
> /httpdocs/controllers
> /httpdocs/models
> /httpdocs/views
> /httpdocs/webroot

Hi Thomas,

Why not change your structure such that your app contents are OUT of
the httpsdocs folder and on the the contents of webroot are IN the
httpdocs folder. It isn't complex to do so and will most likely solve
your url problem in the process. At the moment you have the
disadvantage of a none-standard setup and none of the advantages of a
production setup (since all your app files, and your tmp folder are
still in the webroot)

Ref: http://www.noswad.me.uk/MiBlog/ProductionSetup (on a shared host)

hth,

AD


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-06 Thread [EMAIL PROTECTED]

hello all,

I have a similar issue

I'm on a shared host

my setup is as follow

/cake
/httpdocs (dir accessible by browser)
/httpdocs/controllers
/httpdocs/models
/httpdocs/views
/httpdocs/webroot

the .htaccess file in httpdocs


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

and in webroot


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


in my webroot/index.php

nothing changes from basic installation :

if (!defined('ROOT')) {
//define('ROOT', 'FULL PATH TO DIRECTORY WHERE APP DIRECTORY IS
LOCATED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
//You should also use the DS define to seperate your directories
define('ROOT', dirname(dirname(dirname(__FILE__;
}
if (!defined('APP_DIR')) {
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
define('APP_DIR', basename(dirname(dirname(__FILE__;
}

/**
 * This only needs to be changed if the cake installed libs are
located
 * outside of the distributed directory structure.
 */
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
//define ('CAKE_CORE_INCLUDE_PATH', FULL PATH TO DIRECTORY WHERE
CAKE CORE IS INSTALLED DO NOT ADD A TRAILING DIRECTORY SEPARATOR';
//You should also use the DS define to seperate your directories
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}



only my links are like :

/controller/action

and they appear in the address bar as

webroot/controller/action

which actually causes issues with my auth system

everything is fine if I just type a /controller/action url in the
address bar
but html links cause problems

i am a little lost as to what I am doing wrong
I have read this thread and of course I don't want to touch the core

can anyone help ?

thanks in advance

thomas


On Jul 5, 5:22 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 7/5/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote:
>
> >  I'm not surprised... well, I have posted my environment, my
> > variables and my doubts. If you can let me know the reason for regexp,
> > or if you have installed in similar setup and how, that will be
> > helpful.
>
> I have my layout as follows:
>
> cake is in ~/src/cake
> app is in ~/src/
>
> I have multiple apps running off of the same CakePHP core
>
> Now, I use Apache2 so here's a sample entry in my vhosts:
>
> ServerName local.cakedevelopment
> DocumentRoot /home/chartjes/src/cakedevelopment/webroot
>
> 
> Options Indexes FollowSymLinks MultiViews
> AllowOverride All
> Order allow,deny
> allow from all
> 
>
> Now, in my /webroot/index.php all I've done is the following:
>
> if (!defined('CAKE_CORE_INCLUDE_PATH')) {
>  //define ('CAKE_CORE_INCLUDE_PATH', 'FULL PATH TO DIRECTORY
> WHERE CAKE CORE IS INSTALLED. DO NOT ADD A TRAILING DIRECTORY
> SEPARATOR');
>  //You should also use the DS define to separate your directories
>  define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cake');
> }
>
> That's it.
>
> My apps work just fine, no need to hack dispatcher or any other part
> of Cake to get it to work.
>
> I say this all the time:  CakePHP has a set of rules and if you don't
> follow them, you shouldn't be surprised when things don't work.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-05 Thread Chris Hartjes

On 7/5/07, R. Rajesh Jeba Anbiah <[EMAIL PROTECTED]> wrote:
>  I'm not surprised... well, I have posted my environment, my
> variables and my doubts. If you can let me know the reason for regexp,
> or if you have installed in similar setup and how, that will be
> helpful.

I have my layout as follows:

cake is in ~/src/cake
app is in ~/src/

I have multiple apps running off of the same CakePHP core

Now, I use Apache2 so here's a sample entry in my vhosts:

ServerName local.cakedevelopment
DocumentRoot /home/chartjes/src/cakedevelopment/webroot


Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all


Now, in my /webroot/index.php all I've done is the following:

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
 //define ('CAKE_CORE_INCLUDE_PATH', 'FULL PATH TO DIRECTORY
WHERE CAKE CORE IS INSTALLED. DO NOT ADD A TRAILING DIRECTORY
SEPARATOR');
 //You should also use the DS define to separate your directories
 define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'cake');
}

That's it.

My apps work just fine, no need to hack dispatcher or any other part
of Cake to get it to work.

I say this all the time:  CakePHP has a set of rules and if you don't
follow them, you shouldn't be surprised when things don't work.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-05 Thread R. Rajesh Jeba Anbiah

On Jul 5, 8:01 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> >It's not clear what they want to acheive with this regexp, but
> > they're returning the full match ($base.$r[0];); I changed it to
> > ($base.$r[1];)--now seems to be ok.
>
> *sigh*
>
> Why is that people think they must hack simple things like the
> dispatcher to get something to work?
>
> Are you using one of the standard layouts from the CakePHP manual or
> are you moving things around?  Changing where CakePHP is expecting
> things to be leads to silly things like changing the dispatcher.
>
> Honestly, I've never had to touch anything in the core to get my apps
> to work.  The culprit is usually incorrect settings in
> webroot/index.php or a bad rewrite rule in .htaccess.
>
> I know people like to think they find errors in the core of an
> application when their stuff won't work, but please PLEASE read the
> manual's section on configuration so you UNDERSTAND what CakePHP is
> expecting.


 I'm not surprised... well, I have posted my environment, my
variables and my doubts. If you can let me know the reason for regexp,
or if you have installed in similar setup and how, that will be
helpful.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-05 Thread Chris Hartjes

>It's not clear what they want to acheive with this regexp, but
> they're returning the full match ($base.$r[0];); I changed it to
> ($base.$r[1];)--now seems to be ok.
>

*sigh*

Why is that people think they must hack simple things like the
dispatcher to get something to work?

Are you using one of the standard layouts from the CakePHP manual or
are you moving things around?  Changing where CakePHP is expecting
things to be leads to silly things like changing the dispatcher.

Honestly, I've never had to touch anything in the core to get my apps
to work.  The culprit is usually incorrect settings in
webroot/index.php or a bad rewrite rule in .htaccess.

I know people like to think they find errors in the core of an
application when their stuff won't work, but please PLEASE read the
manual's section on configuration so you UNDERSTAND what CakePHP is
expecting.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation

My motto for 2007:  "Just build it, damnit!"

@TheBallpark - http://www.littlehart.net/attheballpark
@TheKeyboard - http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-05 Thread [EMAIL PROTECTED]

I was using symlinks actually.  This worked Tarique.  Thanks!
Wilson

On Jul 5, 6:53 am, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
> On Jul 5, 10:49 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:> Are you 
> using symlinks by any chance?
>
> > If yes then point the symlink to the app folder rather than the outside
> > folder - this had solved the problem for me
>
>
>
> Thanks for the point. I'm not using symlinks. The problem seems to
> be with dispatcher.php baseUrl() function line# 515 (svn rev 5334)
>  dispatcher.php#L515>
>
> I think, I got that fixed. Thanks anyway.
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-05 Thread R. Rajesh Jeba Anbiah

On Jul 5, 10:49 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]> wrote:
> Are you using symlinks by any chance?
>
> If yes then point the symlink to the app folder rather than the outside
> folder - this had solved the problem for me
   

Thanks for the point. I'm not using symlinks. The problem seems to
be with dispatcher.php baseUrl() function line# 515 (svn rev 5334)


I think, I got that fixed. Thanks anyway.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-05 Thread R. Rajesh Jeba Anbiah

On Jul 4, 8:58 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> I'm curious about this too, Rajesh.
>
> It actually causes my sessions to expire when the webroot link is
> appended.  Has anyone fixed this before?
  

   Problem is with the dispatcher.php baseUrl() function line# 515
(svn rev 5334) 

   On this line, for me:
$webrootDirName = 'webroot';
$scriptName = '/webroot/index.php';
   so, $regs = Array([0] => /webroot, [1] => , [2] => )

   It's not clear what they want to acheive with this regexp, but
they're returning the full match ($base.$r[0];); I changed it to
($base.$r[1];)--now seems to be ok.

   I suppose, anyone who is deploying projects under /public_html/
should get this issue.

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-04 Thread Dr. Tarique Sani
Are you using symlinks by any chance?

If yes then point the symlink to the app folder rather than the outside
folder - this had solved the problem for me

Tarique

On 7/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> I'm curious about this too, Rajesh.
>
> It actually causes my sessions to expire when the webroot link is
> appended.  Has anyone fixed this before?
>
> Thanks,
> Wilson
>
> On Jul 4, 11:32 am, "R. Rajesh Jeba Anbiah"
> <[EMAIL PROTECTED]> wrote:
> >   I have setup like this:
> >
> > ROOT\.cake\
> > ROOT\public_html\
> >
> > 'CAKE_CORE_INCLUDE_PATH' set to  ROOT.DS.'.cake'   in  ROOT\public_html
> > \webroot\index.php
> >
> >  When I accesshttp://foo.com/, the subsequent links are appended
> > with "webroot", sayhttp://foo.com/webroot/users/login
> >
> >  I have trapped up to dispatcher, but still couldn't find the
> > reason. Could anyone has any idea? TIA
> >
> > --
> >   
> > Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/
>
>
> >
>


-- 
=
Cheesecake-Photoblog: http://cheesecake-photoblog.org
PHP for E-Biz: http://sanisoft.com
=

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: "webroot" getting appended in subsequent links?

2007-07-04 Thread [EMAIL PROTECTED]

I'm curious about this too, Rajesh.

It actually causes my sessions to expire when the webroot link is
appended.  Has anyone fixed this before?

Thanks,
Wilson

On Jul 4, 11:32 am, "R. Rajesh Jeba Anbiah"
<[EMAIL PROTECTED]> wrote:
>   I have setup like this:
>
> ROOT\.cake\
> ROOT\public_html\
>
> 'CAKE_CORE_INCLUDE_PATH' set to  ROOT.DS.'.cake'   in  ROOT\public_html
> \webroot\index.php
>
>  When I accesshttp://foo.com/, the subsequent links are appended
> with "webroot", sayhttp://foo.com/webroot/users/login
>
>  I have trapped up to dispatcher, but still couldn't find the
> reason. Could anyone has any idea? TIA
>
> --
>   
> Email: rrjanbiah-at-Y!comBlog:http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



"webroot" getting appended in subsequent links?

2007-07-04 Thread R. Rajesh Jeba Anbiah

  I have setup like this:

ROOT\.cake\
ROOT\public_html\

'CAKE_CORE_INCLUDE_PATH' set to  ROOT.DS.'.cake'   in  ROOT\public_html
\webroot\index.php

 When I access http://foo.com/, the subsequent links are appended
with "webroot", say http://foo.com/webroot/users/login

 I have trapped up to dispatcher, but still couldn't find the
reason. Could anyone has any idea? TIA

--
  
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---