# forcefully change domain ‘site.tw’ and assign language to ‘en’.

[code language=”ruby”]
def change_domain_and_lang(url)
uri = URI.parse(url)
uri.host = "site.tw"
params = uri.query
uri.query = if params
cgi = CGI.parse(params)
cgi[‘lang’] = ["en"]
URI.encode_www_form(cgi)
else
"lang=en"
end
return uri.to_s
end
[/code]