Configuring CakePHP on RackSpace Cloud
CakePHP is a great application framework for “developing rapid websites”. I’ve started building quite a few websites with the system and become quite fond of the MVC framework, the native built-in functionality and vast amount of support available.
When I came to setup an application on RackSpace Cloud Sites (previously known as Mosso), due to the unique way the server was configured (running both Apache and IIS simultaneously), CakePHP didn’t want to work straight out the box.
It was only after quite few hours of research and live chat from the hosting support team that I discovered there were several tweaks that had to be made for CakePHP to work on the Rackspace Cloud.
Basically, it all comes down to the .htaccess files and RewriteBase.
- In the route .htaccess file, add the following line:
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase / # Cake Defaults RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule>
- In the app folder, add the following line to your .htaccess file:
<IfModule mod_rewrite.c> RewriteEngine on RewriteBase /app RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule>
- In the app/webroot folder, add the following line to your .htaccess file:
<IfModule mod_rewrite.c> RewriteEngine On RewriteBase /app/webroot RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>
That should do it.





