Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Feature Requests
  3. Avoid multiple redirects when using www.

Avoid multiple redirects when using www.

Scheduled Pinned Locked Moved Solved Feature Requests
6 Posts 3 Posters 826 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • marcusquinnM Offline
    marcusquinnM Offline
    marcusquinn
    wrote on last edited by marcusquinn
    #1

    Since Cloudron is handling the redirects, I don't think it would be efficient to do in the .htaccess for every site.

    Based on this Google Pagespeed report for http://marcusquinn.com which will be the first try for anyone typing in a domain:

    • https://developers.google.com/speed/pagespeed/insights/?url=marcusquinn.com&tab=mobile&hl=en_GB

    67e8eee5-2dc6-4489-8423-cd3cf1f240c0-image.png

    e799ac5f-6e84-449f-a3d9-59bb7f9f02cb-image.png

    Compared to:

    • https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fwww.marcusquinn.com%2F&hl=en_GB

    5d8360cb-feca-4353-a18e-69b1c4e9be7c-image.png

    In reference to these articles:

    • https://www.yes-www.org/why-use-www/
    • https://www.danielmorell.com/guides/htaccess-seo/redirects/https-www-and-trailing-slash
    • https://www.danielmorell.com/guides/htaccess-seo/sample-code/redirect-sample-code#https-www-files

    It seems this generator would be good for the default setup when www. is the Main location:

    • https://www.danielmorell.com/tools/htaccess/redirect-generator

    For example::

    05485f34-449e-4d19-87ab-16f240d61077-image.png

    My website if you're interested in my ramblings on technology too 🙂 :

    • https://www.marcusquinn.com

    Will do a proper write-up post on Cloudron once I'm happy with my setup 😉

    Web Design https://www.evergreen.je
    Development https://brandlight.org
    Life https://marcusquinn.com

    1 Reply Last reply
    2
    • girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by
      #2

      Good point. If i understand correctly, you want http://foo.com to redirect to https://www.foo.com directly. FWIW, because of redirect caching + HSTS this just a one time thing (atleast for that user+browser)

      marcusquinnM 1 Reply Last reply
      2
      • girishG girish

        Good point. If i understand correctly, you want http://foo.com to redirect to https://www.foo.com directly. FWIW, because of redirect caching + HSTS this just a one time thing (atleast for that user+browser)

        marcusquinnM Offline
        marcusquinnM Offline
        marcusquinn
        wrote on last edited by marcusquinn
        #3

        @girish Yes please 🙂 Same principles would be equally valuable to those using Ghost / Wordpress / Surfer for their www. site.

        Might be worth a note in the Docs too with a link to the above commentary on the reasons for choosing to use www. as it would help make high-availability multi-Cloudron setups possible, where you can have multiple CNAME IPs for a subdomain but not the naked root domain AFAIK.

        Web Design https://www.evergreen.je
        Development https://brandlight.org
        Life https://marcusquinn.com

        1 Reply Last reply
        1
        • girishG Offline
          girishG Offline
          girish
          Staff
          wrote on last edited by girish
          #4

          I have fixed this for the next release (5.6). Thanks for reporting.

          1 Reply Last reply
          1
          • rmdesR Offline
            rmdesR Offline
            rmdes
            wrote on last edited by
            #5

            I simply add www for most apps because too many people are used to type this before reaching their destination.
            But from reading this thread I'm even more confused ?

            I thought dropping www was not such bad idea, a bit a useless remain from when hosting was hard? I may be completely wrong but I really want to understand what's the best thing to do, certainly if it impacts SEO etc...

            marcusquinnM 1 Reply Last reply
            0
            • rmdesR rmdes

              I simply add www for most apps because too many people are used to type this before reaching their destination.
              But from reading this thread I'm even more confused ?

              I thought dropping www was not such bad idea, a bit a useless remain from when hosting was hard? I may be completely wrong but I really want to understand what's the best thing to do, certainly if it impacts SEO etc...

              marcusquinnM Offline
              marcusquinnM Offline
              marcusquinn
              wrote on last edited by
              #6

              @rmdes I think from a user point of view it just needs to work with either, they don't really care as long as typing results in what they were hoping for. From a Sys Admin point of view, www. is more flexible for scaling and high-availability setups. As an example, if you use Odoo enterprise, it must be www. for the websites.

              Web Design https://www.evergreen.je
              Development https://brandlight.org
              Life https://marcusquinn.com

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Bookmarks
              • Search