normalize-url icon indicating copy to clipboard operation
normalize-url copied to clipboard

Stripping www. does not work when there is a subdomain in URL

Open Tay0108 opened this issue 5 years ago • 2 comments

When trying to strip www. from link with subdomain (e.g. www.unix.stackexchange.com) it does not work, www. stays. Is this intended behavior?

Tay0108 avatar Apr 30 '20 09:04 Tay0108

See https://github.com/sindresorhus/normalize-url/issues/38#issuecomment-289641049

sindresorhus avatar Apr 30 '20 15:04 sindresorhus

Hey,

I came here to say that I find stripping the www subdomain a strange default choice. I had expected that this library would normalize the URL as much as possible but by absolutely minimizing the risk of breaking the URL. As someone who hosts websites myself, I'd say it's fairly common that there isn't a totally clean mapping between www and the apex domain. It might be kinda hard flipping that default choice, but I'd still welcome it.

TimDaub avatar Oct 25 '23 18:10 TimDaub