I’m trying to read all the suggestions and tips that are present in this forum but I cant find a way to make this rule work. I want that if a specific url is requested that nginx redirect permanently to a subdomain:
if ($host = 'www.domain.com/zh/') redirect www.cn.domain.com$requested_uri
The syntax its not correct but its only to give the main idea, I only want that
/zh/ jump to sub domain, the other like
/jp/, etc. I don’t want nginx make any redirect.
Thank you very much, all help will be very appreciated.
This is pretty easy. You don’t even need
rewrite ^/zh/(.*) http://www.cn.example.com/$1 permanent;
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.