We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42650
    • 4 Posts
    Hi all!
    This is my first post in these forums.

    I have multiple domains hosted on godaddy, of the same company like

    company.com
    company.us
    company.co.uk and so on

    plus one other website completely different to the above which in not based on ModX.

    I have the .com in the root folder and all the other domains inside subfolders in the root folder. I'm using Evo latest patch.
    I have installed a shop and a forum (forum.company.com & shop.company.com).
    All was working great until I tried to redirect non-www to www urls using the classic .htaccess way:

    # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.company\.com [NC]
    RewriteRule (.*) http://www.company.com/$1 [R=301,L]


    Rewriting the .htaccess files of the domains inside the subfolders (.us / .co.uk etc) works for each one of them.
    Rewriting the .htaccess file of the .com domain inside the root folder breaks the other website and the forum in the following ways:

    otherwebsite.com resolves OK but
    otherwebsite.com/category1 resolves to www.company.com/otherwebsite.com/category1
    otherwebsite.com/category2 resolves to www.company.com/otherwebsite.com/category2
    otherwebsite.com/category3 resolves to www.company.com/otherwebsite.com/category3
    etc.

    and

    forum.company.com resolves to www.company.com/forum
    forum.company.com/whatever resolves to www.company.com/forum/whatever

    and this way the forum is not working properly.



    Is there anything I could do to fix this? I have tried moving the .com domain inside a subfolder of its own and use the .htaccess way but it didn't work.

    cheers
      • 22840
      • 1,572 Posts
      Not a godaddy expert ( thank god ), but in my experience if you create a sub domain on a server you should update your dns and create a cname to point the subdimain
      to the IP address of the server, then the server will pick it up as a subdomain.
        • 42650
        • 4 Posts
        Quote from: paulp at Jan 29, 2013, 03:44 PM
        Not a godaddy expert ( thank god ), but in my experience if you create a sub domain on a server you should update your dns and create a cname to point the subdimain
        to the IP address of the server, then the server will pick it up as a subdomain.

        Thank you for your quick response.
        I noticed that GoDaddy has a redirect utility which I hadn't seen before for 301 or 302 redirects. Using it instantly solved the .com redirection problem without breaking the forum or the other website. Plus I was able to redirect instantly the other website (which is not built on MODX) from non-www to www.

        I didn't need the dns update so far but it looks like it could solve another problem that I have.
        I have the .au domain registered in another provider but I can't make it resolve using the GoDaddy nameservers. Should I point it to the server ip address or create a cname to point to the subdomain? A subfolder already exists for the .au domain.
        I'll try both and report back.

        Thanks
          • 19604 ☆ A M B ☆
          • 179 Posts
          Quote from: remyme at Jan 29, 2013, 04:47 PM

          I have the .au domain registered in another provider but I can't make it resolve using the GoDaddy nameservers. Should I point it to the server ip address or create a cname to point to the subdomain? A subfolder already exists for the .au domain.
          You have to change the A-record with the provider that you registered, which is usually the IP of the target server, in this case GoDaddy. At GoDaddy (never used it, so I am just guessing) there should be an option for hosting external domains. There you have to tell the system, that it shall react to request for this external domain and also tell the system, where the homefolder resides. That's it.

          I like to structure my servers like "/domain.com/www", "/domain.com/subdomain1" etc. Every subdomain (www is technicale just a subsomain) get its own folder below the secend level domain name.For each redirect I use the same target, like "www.domainWasMisstyped.cz" pointing at "/domain.com/www", with a htaccess that rewrites allthose "falses" to "www.domain.com". This way you can place a separate htaccess into every subfolder. And you can easily create canonical URL, so you don't end up with 2 websites (with and without "www") having the exact same content. Google does not like that to much.
            MINDEFFECTS – DESIGN for PRINT, WEB and MEDIA
            http://twitter.com/mindeffects · http://www.facebook.com/mindeffects · http://www.youtube.com/mindeffects/ · skype://mindeffects_oliver
            • 42650
            • 4 Posts
            Quote from: mindeffects at Jan 29, 2013, 05:22 PM
            Quote from: remyme at Jan 29, 2013, 04:47 PM

            I have the .au domain registered in another provider but I can't make it resolve using the GoDaddy nameservers. Should I point it to the server ip address or create a cname to point to the subdomain? A subfolder already exists for the .au domain.
            You have to change the A-record with the provider that you registered, which is usually the IP of the target server, in this case GoDaddy. At GoDaddy (never used it, so I am just guessing) there should be an option for hosting external domains. There you have to tell the system, that it shall react to request for this external domain and also tell the system, where the homefolder resides. That's it.

            I like to structure my servers like "/domain.com/www", "/domain.com/subdomain1" etc. Every subdomain (www is technicale just a subsomain) get its own folder below the secend level domain name.For each redirect I use the same target, like "www.domainWasMisstyped.cz" pointing at "/domain.com/www", with a htaccess that rewrites allthose "falses" to "www.domain.com". This way you can place a separate htaccess into every subfolder. And you can easily create canonical URL, so you don't end up with 2 websites (with and without "www") having the exact same content. Google does not like that to much.

            Thank you for your answer!
            This is what I was looking for, the A record. I just changed it and I am waiting for the changes to take effect.
            I had already done what you suggested at GoDaddy's Hosting Panel.
            Every subdomain has its own .htaccess file redirecting non-www to www and working flawlessly.

            Thanks and let's hope it finally resolves!
              • 22840
              • 1,572 Posts
              Just so you know going forward and if you ever use another host, some require it to be a A record and some to be a cname, if you try one and it gives you a error just go for the second ;-)
                • 42650
                • 4 Posts
                Quote from: paulp at Jan 29, 2013, 05:42 PM
                Just so you know going forward and if you ever use another host, some require it to be a A record and some to be a cname, if you try one and it gives you a error just go for the second ;-)

                Both my local registrar and GoDaddy have an A (Host) and CNAMES (Aliases).
                The A name requires typing in an ip.
                The CNAMES require that a canonical name-Destination is typed (eg. example.domain.au)
                Could it be that A name is for external reference and CNAMES for internal?