João Paulo Cercal

Staff Security Engineer at LastPass

  • PHP

CakePHP problem with mod_rewrite

  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Read this article in

Hello, good evening. Today I had problems with CakePHP URL rewriting, and decided to share the error and how I solved it.

CakePHP problem with mod rewrite

The problem was that when I tried to access the application’s URL through the browser, it returned the following error 404 – Not Found.

Well, first, after looking for inconsistencies in controller and action names, clearing the cache, checking whether URL rewriting was enabled in Apache, etc, I turned to Google. After some research, I found the solution in Cake’s own documentation.

It turned out that a .htaccess file was missing from the application’s ROOT directory. For some reason I had deleted this file by accident.

So, for anyone else having trouble. Here’s the solution, and other possible solutions to this problem: CakePHP Documentation.