我正在尝试将 CakePHP 应用程序安装在与 Wordpress 站点相同的目录中。CakePHP 应用程序只有几个控制器,所以我认为这应该可以通过添加几个RewriteCond
s. 不幸的是,以下 /.htaccess 文件无法正常工作:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#start my additions
RewriteCond %{REQUEST_URI} !^/admin
RewriteCond %{REQUEST_URI} !^/tests
RewriteCond %{REQUEST_URI} !^/users
RewriteCond %{REQUEST_URI} !^/css/
RewriteCond %{REQUEST_URI} !^/js/
#end my additions
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
#CakePHP rules
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/$
RewriteRule (.*) app/webroot/$1 [L]
由于某种原因,找不到 Wordpress 样式表:
GET http://example.dev/wp-content/themes/sow3/style.css?1365621024 404 (Not Found)