Hello,
I have the following Rewrite Logic, and it's working to redirect the subdomain, partially. If I visit the URL http://subdomain.clientcollabhq.com/some/path it redirects properly, but if I visit http://subdomain.clientcollabhq.com/ it skips the RewriteCond blocks for the subdomain and falls into the fallback RewriteRule. Any idea what's going on?
#
# 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>
Regards,
Andrew