Question

If we deploy cakephp not on root domain, but under something like

http://domain.com/folder/app-name as the root domain for cake

When we use something like $this->Form->create('abc')

it will generate post url to http://domain.com/controller/action instead of http://domain.com/folder/app-name/controller/action

how do we configure cake for this purpose?

Was it helpful?

Solution

No, it won't. It always picks it up correctly. Are you sure this is happening? Because on all my CakePHP installations it works correctly. That's the whole point of using the Form helper and HTML helper, they'll get the path right irrespective of where you deploy it.

When you're using jquery stuff, one way to solve it is to the below code to generate URL instead of hard coding them.

<?php echo $html->url('controller' => 'foo', 'action' => 'bar'); ?>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top