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. Install/Set App locations to a subdirectory

Install/Set App locations to a subdirectory

Scheduled Pinned Locked Moved Feature Requests
11 Posts 3 Posters 1.0k 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

    It would be super useful to be able to install/set App locations to a subdirectory URL of another App's root URL.

    I can think of a few use-cases for this; WordPress, NodeBB, Discourse, BookStack, Outline, Ghost, etc where it is beneficial to have the app installed to have it's root as a subdirectory of a primary domain, eg:

    • www.example.com/blog
    • www.example.com/forum
    • www.example.com/docs

    etc.

    On Apache, this is just a rewrite rule, eg:

    RewriteEngine On
    
    # Ensure mod_proxy is enabled and available
    RewriteCond %{REQUEST_URI} ^/blog
    
    # Proxy the request
    RewriteRule ^blog/(.*)$ https://blog.example.com/$1 [P,L]
    

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

    1 Reply Last reply
    4
    • marcusquinnM Offline
      marcusquinnM Offline
      marcusquinn
      wrote on last edited by
      #2

      @girish @nebulon Hope you don't mind a mention to see if this is a quick win?

      There's significant SEO value to having all public content apps under a single main domain, as compared to sub-domains, where they are treated as if they are separate sites.

      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
        #3

        For Cloudron, we had looked into this when we started many years ago. It's unlikely to support subdirectory based installations. This causes various problems because cookies, local storage, indexdb etc as they are stored on the domain level and one has to be careful to not leak stuff across apps. This might work if you are in total control of the apps and limiting yourself to specific apps, but in a general level path based installations are not a good idea (for Cloudron). Maybe we have to look into new content protection for apps and things have changed now.

        marcusquinnM 1 Reply Last reply
        1
        • girishG girish

          For Cloudron, we had looked into this when we started many years ago. It's unlikely to support subdirectory based installations. This causes various problems because cookies, local storage, indexdb etc as they are stored on the domain level and one has to be careful to not leak stuff across apps. This might work if you are in total control of the apps and limiting yourself to specific apps, but in a general level path based installations are not a good idea (for Cloudron). Maybe we have to look into new content protection for apps and things have changed now.

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

          @girish WordPress is designed to be installed in a subdirectory as an option, so no issue there. I'd be surprised if forum software hadn't also considered this as an option.

          Given the apps would remain in their respective separate containers, I can't see what issue there would be for leaking anything.

          Each app could still be on it's own subdomain, but the mod_proxy rule would be translating that for the public navigation and search engine indexing.

          From a business point of view for SEO, you're diluting the effectiveness of marketing efforts for every public subdomain, so the business decisions is made based on the decider knowing or caring about that extra cost in time and money, or missed opportunity from not understanding how search engine rankings work.

          Successes with subdomains might still happen despite these headwinds, but could have had tailwinds had they just chosen the path more valued by ranking algos.

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

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

            @marcusquinn the leak happens on the browser side and not the backend side. For example, a plugin in /blog1 can now read the contents/cookies/session/localstorage of /blog2 . If a bad plugin is installed in blog1, then it compromises blog2 .

            But yeah, I agree that WP might benefit here. It's not a trivial feature to implement though.

            marcusquinnM 1 Reply Last reply
            0
            • girishG girish

              @marcusquinn the leak happens on the browser side and not the backend side. For example, a plugin in /blog1 can now read the contents/cookies/session/localstorage of /blog2 . If a bad plugin is installed in blog1, then it compromises blog2 .

              But yeah, I agree that WP might benefit here. It's not a trivial feature to implement though.

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

              @girish That's just all websites, if you have a compromised plugin, you have a compromised plugin, but in this case, that would only be some small footprint access to front-end data, not the separated app admins.

              They aren't exactly separate websites if running on the same domain, though, just using multiple instances of admin software to create different parts of the website.

              I assume this can still be done manually by adding the above to the .htacccess file on one app to then alias a subdirectory to the subdomain URL of another app, since they are both on public URLs?

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

              girishG 1 Reply Last reply
              2
              • marcusquinnM marcusquinn

                @girish That's just all websites, if you have a compromised plugin, you have a compromised plugin, but in this case, that would only be some small footprint access to front-end data, not the separated app admins.

                They aren't exactly separate websites if running on the same domain, though, just using multiple instances of admin software to create different parts of the website.

                I assume this can still be done manually by adding the above to the .htacccess file on one app to then alias a subdirectory to the subdomain URL of another app, since they are both on public URLs?

                girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by
                #7

                @marcusquinn said in Install/Set App locations to a subdirectory:

                I assume this can still be done manually by adding the above to the .htacccess file on one app to then alias a subdirectory to the subdomain URL of another app, since they are both on public URLs?

                yes, correct, this should work.

                marcusquinnM 1 Reply Last reply
                2
                • girishG girish

                  @marcusquinn said in Install/Set App locations to a subdirectory:

                  I assume this can still be done manually by adding the above to the .htacccess file on one app to then alias a subdirectory to the subdomain URL of another app, since they are both on public URLs?

                  yes, correct, this should work.

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

                  @girish Thanks. Going to have to test is, as the subdomain should be noindexed, and the subdirectory indexed, to avoid making a mess of SE and duplicate results in SERPs.

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

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    LoudLemur
                    wrote on last edited by LoudLemur
                    #9

                    Hang on, I thought there was an option somewhere in cloudron where you could toggle the location of the installation. For example, you could, as I think OP wants, opt between:

                    blog.example.com
                    vs
                    example.com.blog
                    example.com/blog

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

                      @LoudLemur I think @marcusquinn wants example.com/blog . But no, there is no option to choose a subpath implementation. This has not been implemented yet at Cloudron level.

                      L 1 Reply Last reply
                      1
                      • girishG girish

                        @LoudLemur I think @marcusquinn wants example.com/blog . But no, there is no option to choose a subpath implementation. This has not been implemented yet at Cloudron level.

                        L Offline
                        L Offline
                        LoudLemur
                        wrote on last edited by
                        #11

                        @girish said in Install/Set App locations to a subdirectory:

                        example.com/blog

                        Woops! yes, that is what I meant to write. Thanks!

                        1 Reply Last reply
                        1
                        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