Exclude directory from routing Options in CakePHP
Sometimes we would like to exclude a specific directory from any CakePHP rerouting. That directory may holds independent website or old website. Our .htaccess file should be like this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/?(directory_to_exclude)/(.*)$
RewriteRule ^.*$ – [L]
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/?(directory_to_exclude)/(.*)$
RewriteRule ^.*$ – [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
Example : RewriteCond %{REQUEST_URI} ^/?(oldsite)/(.*)$
Use (oldsite|test|new) for multiple directories.