Here’s a little note on getting a cakephp app working in your public_html directory. In order to get the mod_rewrite configuration working, add a RewriteBase rule to the .htaccess files in the cakephp source. If your app is located in /home/me/public_html/cakesite/ and the URL to the site is http://host/~me/cakesite you’ll need to change the following .htaccess files:
/home/me/public_html/cakesite/.htaccess
/home/me/public_html/cakesite/app/webroot/.htaccess
Add the following line to these files, just below the line stating “RewriteEnginge On”:
RewriteBase /~me/cakesite/
For example, the first .htaccess file will look like:
RewriteEngine on
RewriteBase /~me/cakesite/
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
Bonus notes with instructions for Debian/Ubuntu systems
You should have mod_rewrite enabled:
$ sudo a2enmod rewrite
$ sudo /etc/init.d/apache2 force-reload
To make sure the use of .htaccess files is actually allowed. In the Directory section of your apache configuration, there should be a line like:
AllowOverride FileInfo
Also, be sure to force-reload Apache after making this change.
