Install CakePHP on ServerFreak

CakePHP-1.1-iPad01-light

To get CakePHP to work with ServerFreak or any other hosting (e.g. IPSERVERONE, 1&1, Godaddy) that serves from a user directory that already uses mod_rewrite, all you have to do is add RewriteBase statements to the .htaccess files that CakePHP uses:

  • /.htaccess
  • /app/.htaccess
  • /app/webroot/.htaccess

Here’s how they should look like after modification.

/.htaccess

<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</ifmodule>

/app/.htaccess

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^$ /webroot/ [L]
RewriteRule (.*) /webroot/$1 [L]
</IfModule>

/app/webroot/.htaccess


<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>

Once you have completed all the steps above, you should have a working CakePHP installation!

Source: 3.3.4 Apache and mod_rewrite (and .htaccess)


Comments

6 responses to “Install CakePHP on ServerFreak”

  1. Kalebarkab Avatar
    Kalebarkab

    I want to find good pop music. Help me please.

  2. Hey, great post, really well written. You should post more about this. I’ll certainly be subscribing.

  3. […] did some searching on the internet, and this is the answer I found. I have adapted it slightly from this site […]

  4. Useful tip dude. Thanks…

    So most of your php dev work done with cakephp?

  5. …will try this on my web hosting provider soon & thanks for sharing :)

  6. […] did some searching on the internet, and this is the answer I found. I have adapted it slightly from this site […]

Leave a Reply

Your email address will not be published. Required fields are marked *