Posts tagged ‘cake’

Using CakePHP with Godaddy

I was able to setup CakePHP on godaddy, the most frustrating part I dealt with was the wild goose chase I was sent on by Google trying to figure it out.

  1. Add Options +FollowSymlinks to three .htaccess files
  2. Add RewriteBase /path/to/app to the /.htaccess file

I first set my site up to work on a sub-directory for practice as the site was already live. When I did this, I set RewriteBase /test (where my directory was test).

Here are the three .htaccess files:

  • base_directory/.htaccess (this was /test while I was setting it up, and / after I moved it later)
    <IfModule mod_rewrite.c>
    	 Options +FollowSymlinks
       RewriteEngine on
    	 RewriteBase /
       RewriteRule    ^$ app/webroot/    [L]
       RewriteRule    (.*) app/webroot/$1 [L]
    </IfModule>
    
  • webapp/.htaccess
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine on
        RewriteRule    ^$    webroot/    [L]
        RewriteRule    (.*) webroot/$1/    [L]
     </IfModule>
    
  • /app/webroot/.htaccess
    <IfModule mod_rewrite.c>
        Options +FollowSymLinks
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
    </IfModule>
    
  • For what it’s worth, I would just complete the first step and see if this suffices (the .htaccess in the application root). I had already changed the latter two files, and didn’t feel like going back and editing them, just in case it might have caused a new headache

After these few changes, it was a breeze really. I just wish I hadn’t been sent on the proverbial wild goose chase for this 2 lines of code that got this app working.

© 2012 - Jeff Ancel
Wordpress Themes
Scroll to Top