Cakephp3 prevent route to Wordpress blog by htacce

2019-07-30 08:33发布

This is the situation i'm facing with:

Assuming this folder structure:

  • cakephp (main site)
  • wordpress (site blog)

The main site was develop with CakePHP3 (mysite.com). I create a Wordpress blog in their own repo. So I want to redirect with htaccess url's like mysite.com/en/blog to another folder outside cake.

This is the htaccess file on the cakephp root, that handle all the request:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>
Header set Access-Control-Allow-Origin "*"

I try adding something like this

RewriteCond %{REQUEST_URI} /en/blog
RewriteRule ^/en/blog$ /path/to/wordpress [L]

To prevent cake handle this route, but i can make it work.

I can make it work if a create subfolders inside cakephp webroot dir, and install wordpress inside it, but is not the best approach..

Any ideas?

Thanks!

0条回答
登录 后发表回答