We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34178
    • 212 Posts
    I created a subdomain as described here:

    http://rtfm.modx.com/display/revolution20/Creating+a+Subdomain+from+a+Folder+using+Virtual+Hosts


    Unfortunately it didn´t work. The problem is when typing in:

    sub.domain.com/file.html

    this will result in being redirected to

    www.domain.com/file.html

    Does anybody have an idea what I maybe have done wrong?

    Here a maybe important additional information concerning the point 'Creating the Virtual Host':
    Instead of editing Apache's httpd.conf file I just created a subdomain in our server-backend which provide that all requests to sub.domain.com are routed to the folder /modx/sub which is the folder created as described in the tutorial mentioned above for the subdomain and contains the files index.php, .htaccess and config.core.php.

    Second: In the file config.core.php there was no line like this:

    define('MODX_CORE_PATH', dirname(__FILE__) . '/core/');


    or

    define('MODX_CORE_PATH', dirname(dirname(__FILE__)) . '/core/');


    Similar lines I only found in the index.html
      • 34178
      • 212 Posts
      Does nobody have an idea what could be the reason for our problems described above?

      Letti
        • 22303 MODX Staff
        • 10,725 Posts
        I think some other folks have used the non-virtual host method with this and made it work, but that configuration is completely different than what is described in that article. Hopefully someone who has made this work with (I assume this is) CPanel subdomains can chime in and let us know what else you might need to do differently for that environment.