mysql - php $_GET item to virtual subdomain with Htaccess -
mysql - php $_GET item to virtual subdomain with Htaccess - i have simple question related php , htaccess. just think have php code : if(isset($_get['word'])) { echo $_get['word']; } so have (for example) : example.com/?word=test and code echo out **test** , question that, how can alter $_get value, virtual subdomain ? for example, want have this, if below address opened : test.example.com then code gets run , echo out **test** . i need htaccess code thing, so, how can htaccess ? i have tried codes couldn't results . you can utilize code in document_root/.htaccess file: rewriteengine on rewritecond %{http_host} !^www\. [nc] rewritecond %{http_host} ^([^.]+) [nc] rewritecond %{query_string} !(?:^|&)word=[^&]+(?:&|$) [nc] rewriterule ^ %{request_uri}?word=%1 [qsa,l] %1 reference value captured in line: rewritecond %{http_host} ^([^.]+) [nc] first part of domain name before dot. php mysql .htacce...