Configure CakePHP in a folder

In web development its a common practice to create aliases in the web server for directory our actual code resides or use folders for multiple projects in the document root.

While using CakePHP I came across a situation where it was giving me error. The application was unable to file the index.php file while the directory structure was OK and file was in the right location. I figured out the solution which was just a simple fix.

If you encounter the same issue you can apply this simple fix. :)

Open your .htaccess file and add "RewriteBase" option and set it to your correct path. Here is how to do it.

For example your path is http://localhost/my-application-location/ then your rewrite base will be "/my-application-location/",

and if your location is http://localhost/outer-folder/inner-folder then your rewrite base will be "/outer-folder/inner-folder/".

Your .htaccess file should look something like this.

Comments