-
Website
http://www.ninjavspenguin.com/blog -
Original page
http://www.ninjavspenguin.com/blog/2007/01/21/cakephp-install-multiple-subdirectories-500-error/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Craigslist Proxy
3 comments · -1 points
-
SFO CAB
4 comments · 1 points
-
BusbyTest
2 comments · 5 points
-
David Noël
1 comment · 12 points
-
carpet cleaning miami
4 comments · 2 points
-
-
Popular Threads
-
See you next year!
1 week ago · 5 comments
-
Popular TV Shows as posters
1 week ago · 1 comment
-
Andy Warhol paints Debbie Harry on an Amiga
2 weeks ago · 1 comment
-
See you next year!
First: in the core cakephp directory
/cake
contents of .htaccess (unedited)
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
This tells cakePHP where you webroot is. If you have a basic install, then this shouldn't need to change. If you have a different directory for your apps, then you'll need to change the directories accordingly.
HTH.
-Penguin
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
I am a newbie to working with rewrite rules and I can't figure out how to path it properly.
these small modifications will save you lots of works!!
what they do are the following :
generate on-the-fly the ROOT-location and more!!!
i have tested it and i loved it myself :)
===========================
so what you need to do is, open the original /app/webroot/index.php
go to line 41 and replace the following lines with the original!
chdir("../../");
$root = getcwd();
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', $root.DS.'apps');
}
if (!defined('APP_DIR')) {
//define('APP_DIR', 'DIRECTORY NAME OF APPLICATION';
define('APP_DIR', basename(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);
due to posting the ’ needs to be changed to ' (the single apos next to enter)
root/
root/app
root/app/webroot
not cake as you suggested above ;)
Thanks for the articel though it's helped me sort my problem out. I had to add RewriteBase / to each .htaccess and it all works great now :)
I moved the app files below the webroot and bake starting working again.
Any idea why?
I never actually got Bake to work, not even in the "normal" configuration. So, unfortunately, I can't be of any help.
Good luck with your projects!
-Penguin
That's some nice .htaccess ninja you got going. I'm glad you were able to find a solution that works for you :)
-Penguin
Awesome job.
Just a short note for CakePHP 1.2: If you want to solve the 500 Error with least changes possible just add the appropriate RewriteBase command to the app/webroot/.htaccess file. This is where any request lands somewhere during the "bootstrap process" anyway and it is easy to remove once an application goes live on a single domain.
Cheers