Tuesday, August 11, 2009

How did i fixed my CakePHP application at Freehostia

Last night i was having problem running my CakePHP application at Freehostia particularly the 500 Internal Server error.

If someone have experienced the same error like what I had. Here's how I corrected it.

Add "/" to your .htaccess file located at /www/cakephp/

From:

RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]


to:


RewriteEngine on
RewriteRule ^$ /app/webroot/ [L]
RewriteRule (.*) /app/webroot/$1 [L]


Now to your .htaccess located at www/cakephp/app

From:


RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]


to:


RewriteEngine on
RewriteRule ^$ /webroot/ [L]
RewriteRule (.*) /webroot/$1 [L]


Lastly, your .htaccess file at www/cakephp/app/webroot

from:


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


to:


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


By adding "/" to your .htaccess files your CakePHP application will work now automagically. Hope that helps.

No comments:

Post a Comment