Gossamer Forum
Home : General : Internet Technologies :

Mod_rewrite - handle a subdomain with .htaccess

Quote Reply
Mod_rewrite - handle a subdomain with .htaccess
I would like to use rewrite rule to handle a subdomain with .htaccess (setting document root for a subdomain). I have the wildcard set on my subdomains.
Domain is: mysite.com
Subdomain is: test.mysite.com

I try to use these rules, to handle the "test" subdomain with .htaccess:
Quote:
RewriteCond %{HTTP_HOST} ^test\.mysite\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/htmlroot/testdir [NC]
RewriteRule ^(.*) /htmlroot/testdir/$1 [L]


Unfortunately the problem is, that typing the following URL:
http://test.mysite.com/aa
will cause to display
http://test.mysite.com/htmlroot/testdir/aa/
in the browser location.


Any idea how to fix the problem?

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Subject Author Views Date
Thread Mod_rewrite - handle a subdomain with .htaccess webmaster33 5693 Dec 11, 2005, 1:33 PM
Thread Re: [webmaster33] Mod_rewrite - handle a subdomain with .htaccess
Dinky 5535 Dec 16, 2005, 12:12 AM
Post Re: [Dinky] Mod_rewrite - handle a subdomain with .htaccess
webmaster33 5491 Dec 16, 2005, 10:48 AM