A common problem encountered in CakePHP applications is when they are moved to the root folder, they end up showing 500 Internal Server Error. We encountered the same. When started with the development, we had used a temporay folder under a common domain name. But when the actual domain was pointed to the application, it was showing up 500 Internal Server error. To put it simply, if we suppose, the application is place under a folder “demo” under a domain name – ourwebsite.com , then it is accessible in the url – www.ourwebsite.com/demo . But if the application is moved to the root folder and accessed directly from www.ourwebsite.com , then it ends up showing 500 Internal Server Error.

The very simple solution to this problem is to check the .htaccess file in the application and change or add  RewriteBase /  .

For example –

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

If RewriteBase / is not present, please add it or change RewriteBase / folder/subfolder to RewriteBase /

500 Internal Server Error in CakePHP application

Leave a Reply