Is this possible point a subdomain to specific variable?
http://whatever.example.com point to http://example.com/file.php?var=1
http://whatever1.example.com point to http://example.com/file.php?var=2
Tried the recommended answer below - the code work but no css style:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(?:www\.)?whatever\.example\.com$
RewriteRule ^ /file.php?var=1 [L,QSA]
RewriteCond %{HTTP_HOST} ^(?:www\.)?whatever1\.example\.com$
RewriteRule ^ /file.php?var=2 [L,QSA]
or
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.example\.com$
RewriteCond %{HTTP_HOST} ^(?:www\.)?([^.]+)\.example\.com$
RewriteRule ^ /file.php?var=%1 [L,QSA]
Got it working by adding <base href=""/>in header and making a folder called cssfolder for my css because root folder wasn't working. I dont know why?
<base href="../" /> "not working"
<base href="/" /> "not working"
<base href="./" /> "not working"
<base href="/cssfolder/" /> "this work"