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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -