A user on our forums is getting the error “Website is invalid.” when attempting to enter his website on his profile.
The url he is using is:
code_man.cybnet.ch
Perhaps the underscore in the sub-domain is triggering the error?
The version of Discourse that we are currently using is:
1.5.0.beta14
It seems this topic might be related:
Some validation would be nice on the “Web Site” field on user profiles.
Currently, users are able to enter invalid URL’s like this one
http://https://www.facebook.com/FacebookUK
Side-note - I feel like “Web Site” should really be “Website”:
the AP Stylebook changed 5/6 years ago
Google search results for “website” - 5,450,000,000
Google search results for “web site” - 597,000,000
pfaffman
(Jay Pfaffman)
March 30, 2016, 6:27pm
2
That’s it. Underscores are not valid characters for hostnames.
In computer networking, a hostname (archaically nodename) is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication, such as the World Wide Web. Hostnames may be simple names consisting of a single word or phrase, or they may be structured.
Internet hostnames may have appended the name of a Domain Name System (DNS) domain, separated from the host-specific label by a period ("dot"). In the latter fo...
2 Likes
But the url works. Perhaps this validation could be overridden by admins if they entered the url?
1 Like
Falco
(Falco)
March 30, 2016, 7:06pm
4
Introduce complexity on the URL validation to let some people who wants a invalid domain on their profile? I don’t think this is a good idea.
2 Likes
pfaffman
(Jay Pfaffman)
March 30, 2016, 7:40pm
5
dGr8LookinSparky:
But the url works.
Well, if that were entirely true, we wouldn’t be having this conversation.
android, dns
https://www.quora.com/Why-are-underscores-not-allowed-in-DNS-host-names
The best solution, in my arrogant computer geek opinion, would be to point the guy to the above web sites and suggest to the guy that he’s doing it wrong and that if he wants to link to his site he should create a CNAME using a -
instead of a _
. (You’d probably want to find a nicer way to say that.)
3 Likes
And what about IDNs? The regular expression validating the website url is so strict that I can’t fit in my perfectly valid URL https://ondřej.caletka.cz
Even using Punycode form of https://ondřej.caletka.cz is not accepted, even though it is perfectly valid here in this very forum post.
2 Likes