Every website used to be like “www.example.com”. Now I rarely encounter this “www.”. Why did it even exist and where has it gone? I also used to run into websites with legitimate domains, but “ww1.” instead of “www.”, these were probably phishing sites, but how did this actually work on top of legitimate domains?


That happens on the server side and how the owner of the site configured it. Some sites would redirect you to the www subdomain. If you go to “example.com”, it (example.com) would redirect you to “www.example.com”. The www part is not assumed and not automatically added by your browser as is the case “with http”. And you can in fact have your server redirect connections to something other than the www subdomain or not redirect at all, you can also not have a www subdomain at all, but these are usually considered bad practices for public facing sites.
Edit: the opposite is also possible and happens some times, where “www.example.com” would just redirect to the main domain “example.com”. This is usually done for backwards compatibility since a lot of people would assume www is necessary and type it out even if it doesn’t exist.