We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35384
    • 26 Posts
    I have a site built in modx 1.0.10. Sometimes when I click items in the navigation the URL that appears in the address bar has autodiscover at the begining like it's a subdomain autodiscover.mydomain.com if I then click other nav items and go back to it displays as a normal URL. This can happen randomly on any of the pages.

    There is not a subdomain called autodiscover so I dont know why it randomly appears. I've asked the hosting company and they don't know why either so it must be something to do with Modx.

    Any ideas, anyone?
      • 13226
      • 953 Posts
      I don't have an answer, but it would interest me to know if you are hosting with Heart Internet - as I had exactly the same problem (different subdomain name) until I moved from their servers.
        • 35384
        • 26 Posts
        Yes I am hosting with Heart Internet, I spoke to them and they didnt know why. Interesting !!
          • 13226
          • 953 Posts
          I couldn't get a solution that actually fully worked.

          For testing try this:

          open your browser, type in your URL with any subdomain name e.g.

          • test.mydomain.com
          • funny.mydomain.com
          • random.mydomain.com

          If it's the same problem, you should be able to navigate your website with any subdomain name even if it hasn't been created.

          Give it a go smiley
            • 35384
            • 26 Posts
            Yes that works, I tried it before contacting them. In fact HEART said this is because of the wild card A record in the DNS.
              • 13226
              • 953 Posts
              I've just gone through the old ticket and found:

              RewriteCond %{HTTP_HOST} !^www\.DOMAINNAME\.com [NC]
              RewriteCond %{HTTP_HOST} !^$
              RewriteRule ^(.*) http://www.DOMAINNAME.com/$1 [L,R=301]

              This re-writes anything before ".DOMAINNAME" and non "www" to the main domain name e.g.

              • "subdomain.mydomain.com" redirects to "www.mydomain.com"
              • "mydomain.com" redirects to "www.mydomain.com"
                • 13226
                • 953 Posts
                Quote from: macboy25 at Sep 12, 2013, 09:55 AM
                Yes that works, I tried it before contacting them. In fact HEART said this is because of the wild card A record in the DNS.
                I've tried a variety of hosting companies and to date they are the only host I have ever used where this happens.

                Just for info - my previous post was my first solution, which worked, but I ended up hosting my site with a different hosting company and low and behold, the problem stopped.
                  • 35384
                  • 26 Posts
                  I have that in my htaccess file. But still get the problem. Although mines slightly different
                  RewriteEngine on
                  RewriteCond %{HTTP_HOST} ^domainname.co.uk [NC]
                  RewriteRule ^(.*)$ http://www.domainname.co.uk/$1 [L,R=301]
                  


                  Oh and it has my actual domain name in there not domainname.co.uk
                    • 13226
                    • 953 Posts
                    Quote from: macboy25 at Sep 12, 2013, 10:24 AM
                    I have that in my htaccess file. But still get the problem. Although mines slightly different

                    Thats the default rewrite rule that comes with MODX.

                    Simply comment it out and add my code below it - obviously changing DOMAINNAME & .com to your domain name & .co.uk

                    The downfall with my code is if you do want to add a subdomain, you will have to remove the code, otherwise the subdomain will always re-direct to the main domain.
                      • 35384
                      • 26 Posts
                      Brilliant, that worked a treat !! Just have to remember not to create any subdomains

                      thanks.