sindresorhus / normalize-url

Normalize a URL
MIT License
840 stars 122 forks source link

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

Open Tay0108 opened 4 years ago

Tay0108 commented 4 years ago

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?

sindresorhus commented 4 years ago

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

TimDaub commented 1 year ago

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.