What is wrong with my htaccess subdomain rewrite? <p>I want to rewrite www.domain.com/s/index.php?s=test into test.domain.com</p> <p>I did it successfully in local host using the following.</p> <pre><code>RewriteCond %{HTTP_HOST} ^([^\.]+)\.localhost$ [NC] RewriteRule ^$ /s/index.php?s=%1 [L] </code></pre> <p>However, when i put it live on my server, it didnt work. below is the code</p> <pre><code>RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.com$ [NC] RewriteRule ^$ /s/index.php?s=%1 [L] </code></pre> <p>What went wrong? Appreciate advices.</p>