Apache .htaccess url重写CakePHP中的子域
在CakePHP中,我通过以下方式为子文件夹添加url重写异常: 在Apache .htaccess url重写CakePHP中的子域,apache,.htaccess,cakephp,mod-rewrite,Apache,.htaccess,Cakephp,Mod Rewrite,在CakePHP中,我通过以下方式为子文件夹添加url重写异常: 在/public\u html/subdomain/.htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/subdomain
/public\u html/subdomain/.htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/subdomain
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
在/public\u html/.htaccess
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/subdomain
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
重新启动发动机
重写基/
重写cond%{REQUEST_URI}^/子域
重写规则^$app/webroot/[L]
重写规则(*)app/webroot/$1[L]
那么,现在我如何才能破例,同时不断地指出这一点呢
http://domain.com/subdomain/some.php
到
http://subdomain.domain.com/some.php
注意,我还想在这个
子域中安装另一个CakePHP应用程序
,您通常根本不需要修改该文件。请注意,您使用的是开发安装,不建议您使用。我使用的是cakephp 2.x,不确定这是否也有开发/生产安装的区别。顺便说一下,我刚刚发现我键入了错误的内容,第一部分应该是/public\u html/subdomain/.htaccess
。