0
我有以下重寫邏輯,它的工作部分重定向子域。如果我訪問URL http://subdomain.clientcollabhq.com/some/path它會正確重定向,但如果我訪問http://subdomain.clientcollabhq.com/,它將跳過子域的RewriteCond塊並落入回退RewriteRule。任何想法發生了什麼?子域重寫邏輯
#
# 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>
問候,
安德魯
工作究竟應該如何現在。謝謝! – 2010-07-27 15:17:09