URL redirect can be useful in a lot situations.
URL redirect works fine.
$ curl -v -L -s github.com
* Rebuilt URL to: github.com/
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 7890 (#0)
> GET http://github.com/ HTTP/1.1
> Host: github.com
> User-Agent: curl/7.54.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 301 Moved Permanently
< Connection: keep-alive
< Keep-Alive: timeout=4
< Location: https://github.com/
< Proxy-Connection: keep-alive
< Content-Length: 0
<
* Connection #0 to host 127.0.0.1 left intact
* Issue another request to this URL: 'https://github.com/'
* Found bundle for host github.com: 0x7fa1ec41ca00 [can pipeline]
* Hostname 127.0.0.1 was found in DNS cache
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 7890 (#1)
* Establish HTTP proxy tunnel to github.com:443
> CONNECT github.com:443 HTTP/1.1
> Host: github.com:443
> User-Agent: curl/7.54.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
<
* Proxy replied OK to CONNECT request
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
// TLDR
sorry, I misunderstood the meaning of url redirect.
What I want to say maybe URL rewrite. Like rewrite google.cn to google.com.
@glin93 Can you provide some scenes about "URL rewrite"? I am not sure whether it is worth implementing.
For example, yinxiang.com and evernote.com. If I want to use the app store version I can only use international account.
Another scene is that many applications choose service based on the system’s region setting. Like safari use google.cn as search engine 谷歌. If I don’t want to change my region but still need google.com service, rewrite will be very useful.
Above all URL rewrite may not be that important in most situations, but it do provide a convenient method for users to control the service as they wish.
@glin93 Can you provide some scenes about "URL rewrite"? I am not sure whether it is worth implementing.
比如 maps.google.cn 已经终止运作了
Most helpful comment
比如 maps.google.cn 已经终止运作了