Friday, May 6, 2011

CakePHP URL not found, 404 error message

If you just installed CakePHP, and you get the the “all is good” page, but with no styles(no colors), that means that you don’t have mod_rewrite enabled on your localhost! Solution:

  1. In the httpd.conf file in apache, change the line “AllowOverride None” to “AllowOverride All”.
  2. Also, search for the line in the httpd.conf file with the word “mod_rewrite”, and remove the pound(#) from the start of the line.
  3. After this is done, and the file is saved, restart your localhost(WAMPP, XAMPP, etc), and try again!

Why does this happen? CakePHP uses URL Rewriting to work, and by default, the localhost installations don’t have it enabled.

Simple as that, happy coding :)

3 comments: