I recently had trouble getting CakePHP running properly in a subdirectory on the Mosso cloud. The main site URL is http://thinkandthrive.com, and the Cake app lives in a folder off the site root called “tw”. So I was able to connect to http://thinkandthrive.com/tw/, but not to http://thinkandthrive.com/tw (without the trailing slash).
The fix to get Cake working in the subdirectory was to add a single line to the .htaccess file in the Cake root directory ( the “/tw” folder in my case). The .htaccess file should look something like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
Add this line after “RewriteEngine on”:
RewriteRule /YOURCAKESUBDIR$ /YOURCAKESUBDIR/ [L]
Obviously, replace “YOURCAKESUBDIR” with the subdirectory your Cake app in running in. So my .htaccess file now looks like this:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /tw/
RewriteRule /tw$ /tw/ [L]
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
(The third line, “RewriteBase /tw/”, is necessary to get CakePHP working in the Mosso hosting environment. If your Cake installation is at the server web root (the Mosso “content” directory) then it should read simply “RewriteBase /”. If your site is not hosted at Mosso just eliminate this line.)
Thanks to Jeff Loiselle for the quick fix: http://jeff.loiselles.com/wordpress/?p=22