我在 Apache 上运行 Zend Framework (PHP) 应用程序。您可能知道,此框架要求将所有 URL 路由到public/index.php
(前端控制器模式)。因此,我在.htaccess
目录中添加了以下规则public_html
:
RewriteEngine On
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]
RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /public/index.php [NC,L]
# rewrite non-www url's
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
newsletter
在DirectAdmin中,我创建了一个名为public_html/newsletter
. 但是,当我访问规则时,将newsletter.mydomain.com/somefile.html
其.htaccess
重定向到http://www.newsletter.mydomain.com//public/newsletter/
.
如何从.htaccess
规则中排除我的子域?