How should I redirect internationalized domain names (IDNAs) to the Location header when redirecting?

Sites with internationalized domain names often want to respond to HTTP requests with a redirect status code (3XX). When they do, they will want to put the redirect target in the header Location.

If a website wants to use an absolute URI in the header Location, how should they provide their domain name? In particular, should IDNA be encoded or not?

(I assume that if it is not IDNA encoded, it should be encoded using RFC 2047, but if it is wrong, let me know.)

+4
source share
1 answer

It must be a valid HTTP URI (in accordance with RFC 3986 and 7230), so non-ASCII characters in the host name must be IDNA encoded. And no, RFC 2047 is not applicable here.

+3
source

Source: https://habr.com/ru/post/1542923/


All Articles