Hosting phpBB3 in a subfolder alongside CakePHP

.htaccess, cakephp, php, phpbb

Solution

In Cake's root `.htaccess` file you can put:

`RewriteRule ^forum/ - [L]`

If you insert this just before `RewriteRule ^$ app/webroot/ [L]` then it will allow requests to `http://www.example.com/forum` to go straight to phpBB, bypassing Cake.

Problem

I have CakePHP files in my web root (suppose `http://www.example.com/`). Now, I wish to host a phpBB3 installation in a folder called "forum" under my web root. So when somebody accesses (`http://www.example.com/forum`), they can use phpBB. How do I achieve this? I've tried looking into CakePHP documentation for routes configuration, but couldn't find anything related to this. I'm pretty sure this has something to do with `.htaccess` but not sure exactly what. Note - I tried creating a folder called `forum` under `app/webroot` but this often redirects to `http://www.example.com/app/webroot/forum`.

Original source