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
  • Brite
  • 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. WordPress (Developer)
  3. Wordpress www.mydomain.com redirects to mydomain.com

Wordpress www.mydomain.com redirects to mydomain.com

Scheduled Pinned Locked Moved Solved WordPress (Developer)
17 Posts 5 Posters 2.4k Views 5 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.
  • H hav81

    @msbt Thanks for the suggestion, I'm a novice with htaccess, how can I see if this is the problem? Thanks

    humptydumptyH Offline
    humptydumptyH Offline
    humptydumpty
    wrote on last edited by
    #7

    @hav81 you can access the htaccess file using the file manager when you go into the app's settings in your cloudron. Go into the PUBLIC folder and htaccess is right there.

    Screenshot 2021-11-29 101243.png

    H 1 Reply Last reply
    1
    • H hav81

      Hello everyone, I'm new to the forum. I'installed wordpress in cloudron and set it up for www.mydomain.com. when web surfing for www.mydomain.com, i get automatic redirected to mydomain.com. this causes google to report redirect error. Could you point me on how to cancel this redirect. Thanks in advance.

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

      @hav81 Did you import an existing WordPress from elsewhere or is this a fresh installation? If it's imported, then was your previous site was located at mydomain.com ?

      H 1 Reply Last reply
      1
      • humptydumptyH humptydumpty

        @hav81 you can access the htaccess file using the file manager when you go into the app's settings in your cloudron. Go into the PUBLIC folder and htaccess is right there.

        Screenshot 2021-11-29 101243.png

        H Offline
        H Offline
        hav81
        wrote on last edited by
        #9

        @humptydumpty, thanks, i learned a new thing, so here is my htaccess file
        Do you see something that cases the redirect from www.mydomain.com to mydomain.com?

        BEGIN WordPress

        Directivele (liniile) între „BEGIN WordPress” și „END WordPress” sunt

        generate dinamic și ar trebui modificate numai prin filtrele WordPress.

        Toate modificările la directivele cuprinse între acești marcatori vor fi suprascrise.

        <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
        RewriteBase /
        RewriteRule ^index.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
        </IfModule>

        END WordPress

        1 Reply Last reply
        0
        • girishG girish

          @hav81 Did you import an existing WordPress from elsewhere or is this a fresh installation? If it's imported, then was your previous site was located at mydomain.com ?

          H Offline
          H Offline
          hav81
          wrote on last edited by
          #10

          @girish thanks for the question
          I've purchased a server on linode.
          On that server I've installef cloudron.
          Then in my cloudron i've installed a fresh wordpress developer module.
          Let me know if I can provide more info to support to figure out why there is a redirect.

          girishG 1 Reply Last reply
          0
          • H hav81

            @girish thanks for the question
            I've purchased a server on linode.
            On that server I've installef cloudron.
            Then in my cloudron i've installed a fresh wordpress developer module.
            Let me know if I can provide more info to support to figure out why there is a redirect.

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

            @hav81 the htaccess file looks like the standard one. Can you send the real domain name to support@cloudron.io and I can try to see if we see the same behavior from the outside ?

            H 1 Reply Last reply
            0
            • H hav81

              Hello everyone, I'm new to the forum. I'installed wordpress in cloudron and set it up for www.mydomain.com. when web surfing for www.mydomain.com, i get automatic redirected to mydomain.com. this causes google to report redirect error. Could you point me on how to cancel this redirect. Thanks in advance.

              xaddisonX Offline
              xaddisonX Offline
              xaddison
              wrote on last edited by
              #12

              @hav81 I had this problem too and I lost my config but I was having luck with using the multi-site enabled with sub-domain however I did not use the root of the sub-domain.

              It was:

              wp.mydomain.com => set as the app in Cloudron primary URL
              used for setup, plugins, users but no real site was here

              then add a subdomain on top of:
              devsite1.wp.mydomain.com => set as a redirect in Cloudron App
              devsite2.wp.mydomain.com => set as a redirect in Cloudron App

              In WP MultiSite I set the URLs to the virutal folders:

              /wp
              /wp/devsite1
              /wp/devsite2

              For Prod I then had planned on cloning and doing another entry with both:

              www.someotherdomain.com www.whatsNot.app (E.G)
              and whatsNot.app as additional redirects and set to a cloned new /wp/whatsnotapp/

              Maybe something like this can be included in the App as an option in setup. I only had to change the two things already mentioned

              Multisite = true in wp-config and then .htaccess.

              It was easier to map the virutal folders to /media so you could see what was going on as well.

              1 Reply Last reply
              0
              • girishG girish

                @hav81 the htaccess file looks like the standard one. Can you send the real domain name to support@cloudron.io and I can try to see if we see the same behavior from the outside ?

                H Offline
                H Offline
                hav81
                wrote on last edited by
                #13

                @girish hello, i've just sent now a email as requested with the info. Thanks

                girishG 1 Reply Last reply
                0
                • H hav81

                  @girish hello, i've just sent now a email as requested with the info. Thanks

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

                  @hav81 thanks for sending across the info. I think in your case what is happening is the reverse of what you said.

                  • If I visit www.domain.com, it is still on www.domain.com .
                  • If I visit domain.com, it redirects to www.domain.com .

                  I suspect the source of your confusion is Google Chrome URL bar. Google chrome drops the www when it displays the location 😕 Please see https://www.bleepingcomputer.com/news/google/google-chrome-hides-www-and-https-in-the-address-bar-again/ . If you click on the URL, you will see that it is www.domain.com.

                  Here is your site, after I visited www.domain.com:

                  5ffa26f7-04df-4030-8344-a3a6139fd178-image.png

                  I then click the URL bar, I see the www and https:

                  3f892678-0f4a-409b-9415-05dd1fb1bbdd-image.png

                  The behavior is better in Firefox.

                  H 1 Reply Last reply
                  2
                  • girishG girish

                    @hav81 thanks for sending across the info. I think in your case what is happening is the reverse of what you said.

                    • If I visit www.domain.com, it is still on www.domain.com .
                    • If I visit domain.com, it redirects to www.domain.com .

                    I suspect the source of your confusion is Google Chrome URL bar. Google chrome drops the www when it displays the location 😕 Please see https://www.bleepingcomputer.com/news/google/google-chrome-hides-www-and-https-in-the-address-bar-again/ . If you click on the URL, you will see that it is www.domain.com.

                    Here is your site, after I visited www.domain.com:

                    5ffa26f7-04df-4030-8344-a3a6139fd178-image.png

                    I then click the URL bar, I see the www and https:

                    3f892678-0f4a-409b-9415-05dd1fb1bbdd-image.png

                    The behavior is better in Firefox.

                    H Offline
                    H Offline
                    hav81
                    wrote on last edited by
                    #15

                    @girish , thanks a lot you are 100% right, I was tricked by Chrome.
                    Many thanks

                    girishG 1 Reply Last reply
                    1
                    • H hav81

                      @girish , thanks a lot you are 100% right, I was tricked by Chrome.
                      Many thanks

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

                      @hav81 there was a bug in the code as well where removing a "redirect" was causing a crash. I have fixed this now - https://git.cloudron.io/cloudron/box/-/commit/cefbe7064f4c7b31fb93bbf7ed85bf916aa5cf39

                      H 1 Reply Last reply
                      2
                      • girishG girish

                        @hav81 there was a bug in the code as well where removing a "redirect" was causing a crash. I have fixed this now - https://git.cloudron.io/cloudron/box/-/commit/cefbe7064f4c7b31fb93bbf7ed85bf916aa5cf39

                        H Offline
                        H Offline
                        hav81
                        wrote on last edited by
                        #17

                        @girish sorry for the long delay in answer, many many thanks

                        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