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?

    • dev_null@lemmy.ml
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      edit-2
      2 days ago

      That’s not true. It’s usually not there, and unlike “http(s)://”, the browser doesn’t assume it for you. www.example.com and example.com can be different websites, so a browser cannot assume the “www”.

      In fact try going to your own instance: www.pawb.social

      It doesn’t work with “www”.

      • 🇰 🌀 🇱 🇦 🇳 🇦 🇰 🇮 @pawb.social
        link
        fedilink
        English
        arrow-up
        1
        arrow-down
        1
        ·
        edit-2
        1 day ago

        If you just entered “reddit.com” into the address bar, it will automatically assume the www. in front. If there’s another valid address such as “old.reddit.com,” you need to enter the prefix in place of www or it will just go to www.reddit.com. 🤦‍♂️

        Websites that don’t use the www subdomain and are valid without it won’t have it get automatically added, but if it’s not valid it will attempt to use the www subdomain and either give a 404 because it doesn’t exist or will send you to a different site than you expect.

        There was a time when you couldn’t even have “reddit.com” work at all without actually typing the www. part. Just like when websites aren’t secure and the automatic HTTPS needs to have the S removed so the page can load.

            • dev_null@lemmy.ml
              link
              fedilink
              arrow-up
              1
              arrow-down
              1
              ·
              edit-2
              18 hours ago

              If you didn’t mean the browser, then I don’t see how this makes any sense:

              if it’s not valid it will attempt to use the www subdomain and either give a 404

              What’s “it” here which is attempting something? It’s not the website since the address was not valid, and a website wouldn’t redirect you to a “www” if it wasn’t valid either and was going to result in a 404. So who’s “attempting” to unsuccessfully use the “www” subdomain?

        • Osan@lemmy.world
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          edit-2
          22 hours ago

          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.

    • Nibodhika@lemmy.world
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      1 day ago

      This is wrong, it’s not there anymore, it used to be, but now lots of pages don’t even redirect it, they just simply don’t work.