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


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved How can I setup a 302 or 301 redirect from a subdomain to an external site?

    Support
    301 redirect 302 redirect redirect subdomain external site
    11
    26
    1212
    Loading More Posts
    • 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.
    • S
      subtlecourage last edited by

      Hello, I need to setup URL redirect 302 from something.mydomain.com to externaldomain.com/path

      Since I am pointing my A records to cloudron, my DNS provider is unable to do this for me and they told me it has to be done on Cloudron's end.

      Thank you for your email! I'm happy to clarify.
      
      Though the DNS of your account is hosted by Fastmail. We
      can only set up such a redirect website if the A records
      of the domain are pointing to our IPs. Currently, I can
      see that you've pointed the A records to a different
      service.
      
      Please contact your WebHost and they'll let you know
      what needs to be done to set up such a redirect. If they
      suggest creating any additional records, you can do so
      from the Settings->Domains->Edit(for your domain)->
      Customize DNS screen.
      
      Feel free to contact me with any additional questions!
      
      
      fbartels 1 Reply Last reply Reply Quote 0
      • fbartels
        fbartels App Dev @subtlecourage last edited by fbartels

        Hi @subtlecourage,

        this could be (sort of) achieved with the surfer app and a simple html. You can read more about it at https://forum.cloudron.io/post/19387.

        S 1 Reply Last reply Reply Quote 1
        • micmc
          micmc last edited by

          Wouldn't the redirection feature of Cloudron simply work?

          https://docs.cloudron.io/apps/#redirections

          Andy


          https://marketingtechnology.agency
          For cutting edge web technologies

          fbartels 1 Reply Last reply Reply Quote 0
          • fbartels
            fbartels App Dev @micmc last edited by

            @micmc said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

            Wouldn't the redirection feature of Cloudron simply work?

            This would only work if the url to be redirected to is also the same Cloudron app.

            micmc scooke 2 Replies Last reply Reply Quote 0
            • micmc
              micmc @fbartels last edited by

              @fbartels said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

              @micmc said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

              Wouldn't the redirection feature of Cloudron simply work?

              This would only work if the url to be redirected to is also the same Cloudron app.

              Yeah, you're right.


              https://marketingtechnology.agency
              For cutting edge web technologies

              1 Reply Last reply Reply Quote 0
              • scooke
                scooke @fbartels last edited by

                @fbartels I hope op will let us know if they tried this or not.

                A life lived in fear is a life half-lived

                1 Reply Last reply Reply Quote 0
                • S
                  subtlecourage @fbartels last edited by

                  @fbartels said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

                  Hi @subtlecourage,

                  this could be achieved with the surfer app and a simple html. You can read more about it at https://forum.cloudron.io/post/19387.

                  @scooke said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

                  @fbartels I hope op will let us know if they tried this or not.

                  HUZZAH!! That worked!

                  I will have to see how advanced surfer will let me get with site design so it is not as ugly as while background and black text. But this is an AWESOME STARTING POINT!!

                  Thanks!

                  robi 1 Reply Last reply Reply Quote 2
                  • robi
                    robi @subtlecourage last edited by

                    @subtlecourage just set the refresh to "0" and you shouldn't even see that.

                    Or change the color of the page.

                    Life of Advanced Technology

                    S 1 Reply Last reply Reply Quote 2
                    • S
                      subtlecourage @robi last edited by

                      @robi

                      It still loads, but for a millisecond.

                      I almost would rather a pretty background and better design to load for 5 seconds or so. But I guess ill just have to play with it.

                      robi 1 Reply Last reply Reply Quote 1
                      • robi
                        robi @subtlecourage last edited by

                        @subtlecourage ..or prep a nice subliminal message ;-]

                        Life of Advanced Technology

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          subtlecourage @robi last edited by

                          @robi
                          HAHAHAHA

                          Thats an excellent idea.

                          Thanks for clicking, dont forget to buy everything!!

                          micmc 1 Reply Last reply Reply Quote 0
                          • micmc
                            micmc @subtlecourage last edited by

                            @subtlecourage said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

                            @robi
                            HAHAHAHA

                            Thats an excellent idea.

                            Thanks for clicking, dont forget to buy everything!!

                            "Teleportation occurring please hold on..." 😀


                            https://marketingtechnology.agency
                            For cutting edge web technologies

                            P 1 Reply Last reply Reply Quote 1
                            • P
                              privsec @micmc last edited by

                              @micmc Oh! Thats Great!

                              1 Reply Last reply Reply Quote 0
                              • C
                                ccfu last edited by

                                Why not use a LAMP app and .htaccess?

                                S 1 Reply Last reply Reply Quote 1
                                • S
                                  subtlecourage @ccfu last edited by

                                  @ccfu
                                  I have never used either.

                                  to reinforce the noob, any documentation on that?

                                  C 1 Reply Last reply Reply Quote 1
                                  • C
                                    ccfu @subtlecourage last edited by ccfu

                                    @subtlecourage

                                    It's very simple. Just spin up a LAMP app with something.mydomain.com as the location. Then, in the file manager create a file .htaccess in the public directory with the following content:

                                    # Permanent URL redirect 
                                    RewriteEngine on
                                    Redirect 301 / https://externaldomain.com/path
                                    

                                    Any requests to something.mydomain.com will then be forwarded to externaldomain.com/path

                                    There is plenty of documentaton on this if you do a Google search for 301 redirect .htaccess. there are also generators that will provide you with the correct code for different scenarios, for example redirecting specific pages.

                                    1 Reply Last reply Reply Quote 4
                                    • T
                                      toxicdorito last edited by

                                      Alrighty, so I'm running into this issue night now. I'm trying to setup over 9 different redirects to htmls. Basically, sub1.domain.com connects to domain.com/sub1.html for all of them. This being a setup for redirection generator links. Theoretically, I could create a app for every sub domain, or I could just setup sub-directories for it. But, I am importing a project that is live, so I'm going to have to stick with the sub-domain method. Is there a way to bypass the redirection without making tons of apps? I know I could do a rewrite condition, however that only works when the redirect is made on the site through htaccess. But redirecting it through the panel ensures that you never reach the htaccess under the sub domain and if you don't specify the sub-domain, the web-server never responds to it.

                                      T 1 Reply Last reply Reply Quote 0
                                      • T
                                        toxicdorito @toxicdorito last edited by

                                        @toxicdorito I see now, that the LAMP App is missing alias, I'm unsure if that might be the fix, but I think so. All I know is, I can't figure this stuff out 😆

                                        nebulon 1 Reply Last reply Reply Quote 0
                                        • nebulon
                                          nebulon Staff @toxicdorito last edited by

                                          @toxicdorito yes the alias features + htaccess rewrite using the LAMP app should solve this for you.

                                          The LAMP app also has multiDomain and thus alias support. Can you double check in the Location tab of the app configure screen in your Coudron dashboard?

                                          T 1 Reply Last reply Reply Quote 0
                                          • robi
                                            robi last edited by

                                            This is also solvable with the Surfer App + aliases and some HTML+JS to redirect incoming subdomains to directory paths/pages.

                                            Life of Advanced Technology

                                            T 1 Reply Last reply Reply Quote 1
                                            • T
                                              toxicdorito @nebulon last edited by

                                              @nebulon f40b59ba-fcef-46fa-8cdd-c42a407a181a-image.png This is all that I see under LAMP, All of the LAMP packages do not show alias for some reason.

                                              1 Reply Last reply Reply Quote 0
                                              • T
                                                toxicdorito @robi last edited by

                                                @robi And see, I've done this in the past. Same with running Kutt and simply making short links using the domains needed. However, I will need LAMP for my setup.

                                                nebulon 1 Reply Last reply Reply Quote 0
                                                • nebulon
                                                  nebulon Staff @toxicdorito last edited by

                                                  @toxicdorito oh actually I see, the alias feature will only be shown with the next release. I was looking at my developer instance which has current master branch version. So then it will be fixed with the next Cloudron version.

                                                  1 Reply Last reply Reply Quote 0
                                                  • girish
                                                    girish Staff last edited by

                                                    I am probably missing something. Support for multi domain/aliases is already in Cloudron 7.

                                                    36396f8d-fc12-4a8c-a545-d0b4269895b8-image.png

                                                    @toxicdorito What is the version of your Cloudron ? The latest lamp package already has support for aliases -

                                                    jdaviescoates 1 Reply Last reply Reply Quote 1
                                                    • nebulon
                                                      nebulon Staff last edited by

                                                      Sorry I actually looked into the wrong place, I happened to look at a previous LAMP app package which didn't have the multidomain flag set. @toxicdorito which LAMP app verison have you installed?

                                                      1 Reply Last reply Reply Quote 0
                                                      • jdaviescoates
                                                        jdaviescoates @girish last edited by jdaviescoates

                                                        @girish said in How can I setup a 302 or 301 redirect from a subdomain to an external site?:

                                                        I am probably missing something. Support for multi domain/aliases is already in Cloudron 7.

                                                        36396f8d-fc12-4a8c-a545-d0b4269895b8-image.png

                                                        @toxicdorito What is the version of your Cloudron ? The latest lamp package already has support for aliases -

                                                        What if we want to create an alias or redirect for our dashboard domain?

                                                        I want https://my.ud.coop to redirect to https://my.uniteddiversity.coop, see https://forum.cloudron.io/post/44785

                                                        I use Cloudron with Gandi & Hetzner

                                                        1 Reply Last reply Reply Quote 0
                                                        • First post
                                                          Last post
                                                        Powered by NodeBB