Install CakePHP on ServerFreak

CakePHP

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)

6 thoughts on “Install CakePHP on ServerFreak

  1. Pingback: Jeremy Burns » Setting up CakePHP on a 1&1 server

  2. Pingback: CakePHP: Setting up CakePHP on 1&1 | Class Outfit Limited

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>