У меня есть следующая логика перезаписи, и она работает, чтобы частично перенаправить субдомен. Если я нахожу URL-адрес http://subdomain.clientcollabhq.com/some/path, он перенаправляет правильно, но если я нахожусь http://subdomain.clientcollabhq.com/, он пропускает блоки RewriteCond для субдомена и попадает в резервный RewriteRule. Любая идея, что происходит?Subdomain Rewrite Logic
#
# ClientCollabHQ
#
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName clientcollabhq.com
ServerAlias *.clientcollabhq.com
DirectoryIndex index.php
DocumentRoot "D:/wamp/www/dropbox/My Dropbox/ClientCollabHQ/www/html"
ErrorLog "D:/wamp/www/dropbox/My Dropbox/ClientCollabHQ/www/logs/error.log"
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf)$ [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -l
RewriteRule^- [L]
RewriteCond %{HTTP_HOST} !^www\.clientcollabhq\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.clientcollabhq\.com$ [NC]
RewriteRule ^(.*)$ /index.php?subdomain=%2&kohana_uri=$1 [PT,L,QSA]
RewriteRule ^(.*)$ /index.php?kohana_uri=$1 [PT,L,QSA]
</VirtualHost>
С уважением,
Эндрю
Работает точно так, как он теперь должен. Благодаря! –