how to rewrite or redirect a subdomain?

Steve Chu stvchu at gmail.com
Wed Aug 8 18:16:44 MSD 2007


I digged the nginx rewrite module, found that it is hard to
rewrite/redirect a subdomain, here's my situation:
I wanna rewrite/redirect "http://xxx.yyy.example.com" to
"http://yyy.example.com/xxx".
I found there's a Variables $host, but how to split it to get "xxx",
then use rewrite module?
any idea?
Thanks.

-- 
Steve Chu
http://stvchu.org





More information about the nginx mailing list