Hello,
I have the following rewrite logic in my vHost and everything seems to be working in regards to redirecting subdomains, but as soon as I add a path to the URI I'm getting an error in my apache_error.log.
Here is the rewrite logic:
RewriteEngine On
# Remove the www alias
RewriteCond %{HTTP_HOST} ^www\.13labs\.net$ [NC]
RewriteRule ^(.+)$ http://13labs.net$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^.+$
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\.13labs\.net$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.13labs\.net$ [NC]
RewriteRule ^(.+)$ /index.php?subdomain=%2&kohana_uri=$1 [PT,L,QSA]
RewriteRule ^(.+)$ /index.php?kohana_uri=$1 [PT,L,QSA]
I am trying to hit admin.13labs.net/login, which should be rewriting to 13labs.net/index.php?subdomain=admin&kohana_uri=/login. However, in my apache_error.log I am receiving the following:
[Mon Aug 30 23:56:06 2010] [error] [client 74.63.151.37] File does not exist: /var/www/13labs.net/html/login
Any clues? I've been playing around with this for about an hour now and I'm stumped...
Regards, Andrew