I have WordPress ins开发者_开发技巧talled in public_html
i.e, root folder and have CakePHP installed in a sub-folder that is public_html/CakeApp
. How do I modify htaccess to make this work?
htaccess file in public_html right now reads:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
When I access mydomain.com/CakeApp
it is re-directed to mydomain.com/CakeApp/users/login
but all it shows is a WordPress 404 error.
Add one more condition for WordPress rewrite rule:
RewriteCond %{REQUEST_URI} !^/CakeApp [NC]
Your .htaccess then should look like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/CakeApp [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
精彩评论