example.com is a better choice for an example domain
MDN URL
https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security
What specific section or headline is this issue about?
Description
What information was incorrect, unhelpful, or incomplete?
foo.com is a real domain, so I think it's better to use example.com when writing examples.
(Sorry, but it is a machine translation)
What did you expect to see?
example.com is better.
Do you have any supporting links, references, or citations?
https://en.wikipedia.org/wiki/Example.com
Do you have anything more you want to share?
No response
MDN metadata
Page report details
- Folder:
en-us/web/http/reference/headers/strict-transport-security - MDN URL: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Strict-Transport-Security
- GitHub URL: https://github.com/mdn/content/blob/main/files/en-us/web/http/reference/headers/strict-transport-security/index.md
- Last commit: https://github.com/mdn/content/commit/ee756fd51ccbc4820a4b334aa753648650ad1d51
- Document last modified: 2025-05-23T16:30:28.000Z
We could do a global search & replace for all foo.com & bar.com examples. There seem to be quite a few
It's a bit unfortunate here, because http://example.com does not redirect to https://example.com :(.
It's a bit unfortunate here, because http://example.com does not redirect to example.com :(.
In those cases, how about using http://developer.mozilla.org/?
I think this is a good idea. (Sorry if this message sounds rude.)
Not at all :)
I see two possible solutions:
- example.com works to illustrate the difference. I assume they don't enforce redirection for the purposes of demonstrating both both http and https. The current URL isn't hyperlinked, but presented as code for example, so any risk is mitigated.
- A working URL isn't needed for the illustration, since it isn't hyperlinked and isn't intended to be visited, so a URL with non-valid TLD would be better.
In the second case, and in keeping with the current example and the traditional use of nonsense words in examples, I would suggest something like foobar.baz. (foo dot bar is off the table because bar is a valid TLD).
This is what I do myself:
- Use
example.comif I just need a domain name and not any specific behavior about the site itself - Use a real site otherwise
So in this case to illustrate HSTS we would use DMO. In other occasions we would likely use example.com. I would prefer to not use a site that seems to not exist for now, because TLDs can be added, especially three-letter ones.
example.com works to illustrate the difference. I assume they don't enforce redirection for the purposes of demonstrating both both http and https. The current URL isn't hyperlinked, but presented as code for example, so any risk is mitigated.
Yes, we're not actually saying that example.com redirects, so it isn't a fatal problem. Just, like I say, unfortunate and potentially surprising for someone who tries copy/pasting it. I think using DMO is a totally reasonable solution.
I know this repeats what @caugner said, but I’d like to propose using http://developer.mozilla.org/ , since—as @wbamberg mentioned—it actually enforces HSTS and I think it’s a good example to illustrate the concept.
For foo.com and bar.com, foo.example.com and bar.example.com could be used if contrast between two domains is needed (neither exists, but they're still reserved as they lie under the example.com second-level domain).
Hello @Josh-Cena
I want to work on this.
But to be on the same page, I will replace it with http://developer.mozilla.org correct?
We should replace this particular one with DMO, yes, but I was saying if we do this then we should replace all other foo.com and bar.com as well, and those should probably be replaced with example.com, unless we are assuming some specific site behavior, in which case we need to find a site that does what it says.
Note, original problem fixed in https://github.com/mdn/content/pull/39853