子域标签中的下划线.是否有效? [英] Underscore in subdomain label.. valid or not?

查看:79
本文介绍了子域标签中的下划线.是否有效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于下划线,Django URLValidator将为此网站URL引发验证错误:

Django URLValidator will raise a validation error for this website URL because of the underscore:

http://beauharnois_bupa.tripod.com/

从我读到的内容来看,有人说这不是一个有效的域名,有人说这是一个有效域名,而RFC似乎说这在子域标签中是合法的,但在主机名中却不是.

From what I've read some says that it's not a valid domain name, some say it is and the RFCs seems to say that it's legal in the subdomain label but not in the hostname.

我的猜测是,由于上述网站可以正常工作,因此在子域标签中是合法的.

My guess is that it is legal in the subdomain label since the website mentioned above works..

谁是对的?

推荐答案

下划线即使在子域中也不是有效字符,因此将被标记为无效字符.但是,某些在某些情况下基于子域组件 do 动态路由请求的站点允许使用下划线,即使从技术上来说它们是无效字符.因此,即使在技术上无效,您仍可以导航到该URL.

Underscores are not valid characters, even in subdomains, so it will be marked as invalid. However, some sites that dynamically route requests based on a subdomain component do allow underscores, even though they're technically an invalid character. So you might be able to navigate to the URL, even though it's technically not valid.

RFC 1035 讨论了域名的结构.

这篇关于子域标签中的下划线.是否有效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆