apache rewrite wild card subdomain name to query string? -
i've search google , read many websites, still have no clue. basically, want internally redirect subdomain names query strings. here's example:
users type user1.mywebsite.com
the url above stays same users, want server intepret mywebsite.com/user?name=user1
can me? thanks.
you can match hostname in rewritecond
.
rewritecond %{http_host} (.+)\.mywebsite.com rewriterule ^(.*)$ mywebsite.com/user?name=%1
Comments
Post a Comment