Here is my directory structure:
root
root/cakephp
root/wordpress
How to redirect
example.com/cakephp
to cakephp
directorywordpress
We have bespoke website that we want to configure it separately with cakephp and all the rerequest like example.com/cakephp
should go to cakephp directory and the rest of requestes goes to our CMS (which is wordpress in wordpress folder).
In the root .htaccess have this rule:
RewriteEngine On
RewriteRule !^(cackephp|wordpress)/ wordpress%{REQUEST_URI} [L,NC]