Wednesday, October 29, 2008

Re: Loading cake app as subdirectory of non-cake app

I have done this with Apache aliases and based off of
http://book.cakephp.org/view/35/Advanced-Installation
This solution has the cake code outside of the website.

1) I physically put the Cake into /var/www/cakeapps/mycakeapp
Where /app and /webroot are under this structure
2) In the Apache configuration I create an aliase so
http://www.example.com/some_dir/my_cake_app
maps to
/var/www/cakeapps/mycakeapp/webroot

for example
Alias /some_dir/my_cake_app "/var/www/cakeapps/mycakeapp/webroot"
<Directory "/var/www/cakeapps/mycakeapp/webroot">
Options All
Order allow,deny
Allow from all
</Directory>


3) Modify webroot/.htaccess by adding a RewriteBase

<IfModule mod_rewrite.c>
RewriteEngine On
# Add the following line
RewriteBase /some_dir/my_cake_app
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

4) Modify webroot/index.php so the following lines are (mileage may
vary)

define('ROOT', '/var/www/cakeapps/mycakeapp/webroot');

define('APP_DIR', 'app');

define('CAKE_CORE_INCLUDE_PATH', '/where/I/store/my/cakes/
cake_1.2.0.7296-rc2'); // Since it is out side

That should do it with a restart of Apache.


On Oct 29, 9:51 am, let_them_eat_cake <ichabo...@gmail.com> wrote:
> I understand how to pull an app out of the cake folder by modifying
> the index.php inside webroot. What I'm after is how to put the app -
> once I've moved it out of the root cake folder by itself - into a
> subfolder of an application that is not a cake application.
>
> For example, say I have an application with a url ofhttp://www.example.com
> This application is just a regular php script that isn't using cake.
> Now, for whatever reason, say I need to havehttp://www.example.com/some_dir/my_cake_app
> point to my cake application. As it's just sitting in a subdirectory
> underwww.example.com, it's no problem to actually pull up the page,
> but the css and js are all wrong, and now my controllers don't work
> anymore. I could hack it and make it work, but I don't want to do
> that. Is there a way to configure it to work, or will I have to hack
> it?
>
> Thanks.
> Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: