Site Overlay

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>

<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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright © 2020 Sugat Shrestha. All Rights Reserved. | Catch Vogue by Catch Themes