Using other apps with CakePHP - htaccess config

One thing that is asked quite a lot on #cakephp is how to use other apps alongside CakePHP, and the answer giving is normally pretty ugly. Stick the files/folders in side webroot/. Although that does work, its not very nice. So ill show you a little trick with .htaccess files.

The first (really simple way) is to use a .htaccess inside the sub folder. For example you can have a copy of Joomla! running alongside cake with no issues when you have the .htaccess for Joomla! enabled. If the app does not have one and/or you would not know what to put in the .htaccess file you have another option

Make Apache stop processing rewrites if it finds a request for your sub directory. This is done by adding a rule for the sub directory and then telling Apache it is the *last* rule to process. The .htaccess file you want to edit is the one found inside your APP directory. All you want to add is the following line:

You can do this for as many sub folders as you wish, by changing the regex accordingly. Its pretty simple to do and a much cleaner way than having all your stuff inside the webroot/ folder of your APP.

on 1/11/10

if i want to have have wordpress at

should i do this
RewriteRule (blog/.*) $1 [L] # adjust the regex to what you want.

is that enuf ?