.htaccess rewrite: subdomain as GET parameter and filepath afterdomain intact
问题 I want to use htaccess to rewrite subdomains to a get paramater but keep everything after the domain intact + adding the parameter to the end or the url. Desired result: http://mpmain.example.com/ -> index.php http://www.example.com/ -> index.php http://hello.example.com/ -> index.php?subdomain=hello http://whatever.example.com/ -> index.php?subdomain=whatever http://whatever.example.com/index.php?page=login -> index.php?page=login&subdomain=whatever http://whatever.example.com/index.php?page