We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi,

    This is a strange one!
    I always create a site on a subdomain first, then once approved, move it to the live domain.
    On this particular site - i have installed modx successfully on dev.domain.com
    and the directory for the subdomain is located in public_html/dev (which is normal.)
    But the only way I can preview the site or login to the site is via:

    www.domain.com/dev

    if I try:

    dev.domain.com/

    The site renders, but all the links are wrong.
    When I check the base_href, it's set to:

    <base href="http://dev.domain.com/dev/"/>

    I have checked my htaccess file which is set to:

    RewriteEngine On
    RewriteBase /

    Which should be correct.

    I CAN get the site to work by changeing the above to:

    RewriteEngine On
    RewriteBase /dev

    and then access it via
    www.domain.com/dev

    but just don't understand why I cannot access it via the subdomain!!

    has anyone coe across anythign like this before?
    The currentl live site on www.domain.com is a wordpress site - I have checked the htacess file in the root of the domain, but all that has is:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Which looks pretty standard?

    Any ideas?
    I'm stumped!!

    Thanks!
    Andy

    This question has been answered by tm2000. See the first response.

      • 37242 ☆ A M B ☆
      • 339 Posts
      Hi,

      did you empty the cache, check all templates for an older <base href> and all relevant paths inside /core/config/config.inc.php?

      Best regards

      Guido
        • 51020
        • 670 Posts
        Quote from: gallenkamp at May 18, 2016, 07:37 AM
        Hi,

        did you empty the cache, check all templates for an older <base href=""> and all relevant paths inside /core/config/config.inc.php?

        Best regards

        Guido

        Yes I tried all that thanks. It seems it may have something to do with the htaccess file int he root folder - as there us currently a Wordpress site there (yuk).

        Will see if I can move the subdomain outside of the root folder I think.
          • 3749
          • 24,544 Posts
          Do you have this exact tag in the head section of all templates?

          <base href=`"[[++site_url]]"` />


          If you have more than one front-end context, it should be:
          <base href=`"[[!++site_url]]"` />
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 51020
            • 670 Posts
            Quote from: BobRay at May 18, 2016, 11:45 PM
            Do you have this exact tag in the head section of all templates?

            <base href="`"[[++site_url]]"`">


            If you have more than one front-end context, it should be:
            <base href="`"[[!++site_url]]"`">

            Thanks Bob - yes I have that in the head, and I only have a single context.
            It seems to be related to the htaccess file which is in the root directory (powering the Wordpress site that I'm replacing). I moved the subdomain to outside of the public_html, then reran set up and it's all fine now! Didn't get to the bottom of it, but found a workaround - which is second best I guess!

            Thanks for the suggestion though.
            • discuss.answer
              • 51020
              • 670 Posts
              Quote from: BobRay at May 18, 2016, 11:45 PM
              Do you have this exact tag in the head section of all templates?

              <base href="`"[[++site_url]]"`">


              If you have more than one front-end context, it should be:
              <base href="`"[[!++site_url]]"`">

              Thanks Bob - yes I have that in the head, and I only have a single context.
              It seems to be related to the htaccess file which is in the root directory (powering the Wordpress site that I'm replacing). I moved the subdomain to outside of the public_html, then reran set up and it's all fine now! Didn't get to the bottom of it, but found a workaround - which is second best I guess!

              Thanks for the suggestion though.
                • 3749
                • 24,544 Posts
                I'm glad you got it sorted. smiley
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting