title: CakePHP 2.x .htaccess: Get 500 Internal Server Error
body: <p><strong>Problem solved</strong></p>
  
  <ol>
  <li>Changed all folder and file permissions to 755</li>
  <li>All .htaccess files
  with absolute paths (/app/webroot/)</li>
  </ol>
  
  <hr>
  
  <p>I moved my CakePHP 2.x website to another hoster (cyon.ch). Now i got 500 Internal Server Error. I tryed all the fixed who are recommended for the 1and1 hoster, but they won't work.</p>
  
  <p>The error comes from the /app/webroot/.htacces file, cause the others seems to work. If i try to call a image from the webroot/img directory, it works fine (www.myDomain.ch/img/myPicture.jpg), but not the index.php file.</p>
  
  <pre><code>AddType text/x-component .htc
  
  &lt;IfModule mod_rewrite.c&gt;
      RewriteEngine On
  
      # FORCE WWW
      RewriteCond %{HTTP_HOST} !^www\.myDomain\.ch$
      RewriteRule ^(.*)$ http://www.myDomain.ch/$1 [R=301,L]
  
      # REMOVE TRAILING SLASHES
      RewriteRule ^(.*)/$ http://%{HTTP_HOST}/$1 [R=301,L]
  
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^(.*)$ index.php [QSA,L]
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>The "FORCE WWW" and "REMOVE TRAILING SLASHED" are ok as well, if i type myDomain.ch/, i'll got redirect to www.myDomain.ch.</p>
  
  <p>My Domain points to /path/to/root/public_html. Thats also the folder, in which the cake app folder is located.</p>
  
  <p>Any idea?</p>
  
  <p>Thanks in advance!</p>
  
  <p>Edit: I found this error in the error log (Permissions for index.php are set to 755)</p>
  
  <pre><code>SoftException in Application.cpp:256: File "/home/myUsername/public_html/app/webroot/index.php" is writeable by group
  </code></pre>