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

    I’ve got a modx-0.9.6.3 installation, which is accessable via my primary domain.

    I’d like to access the same installation via a second URL, a subdomain, i.e. http://dev.domain.tld (manager und websites), but I can’t get it running.

    I use lighttpd as webserver, and I have more vhosts for other modx installations on the same server, running fine.

    The problem: When I access modx via the dev-vhost, the manager works fine, but the website’s links point to http://domain.tld, not to http://dev.domain.tld, thus I don’t remain on the subdomain.

    I’m using friendly URLs, I suppose there could be a problem with the rewriting. Rewriting is possible with lighttpd, in case someone knows lighttpd I’ve posted the lighttpd vhost below.

    But maybe it’s something completly different?

    Any help is greatly appreciated.

    Cheers
    Frisco

    # vhost fuer interne Zugriffe auf domain.de (am Logfile vorbei)
    $HTTP["host"] =~ "dev\.domain\.de$" {
    server.document-root = "/var/www/cms/modx"
    server.errorlog = "/var/log/lighttpd/error.log"
    accesslog.filename = "/var/log/lighttpd/access.log"
    url.rewrite-once = ( "^/(assets/|manager/|favicon\.ico).*" => "$0",
                           "^/(.*)\?(.*)$" => "/index.php?q=$1&$2",
                           "^/(.*)$" => "/index.php?q=$1",
                         )
    }
      • 10190
      • 187 Posts
      ... an maybe helpful amandment:

      The problem described above seems only to appear if calling the top site of the subdomain. So when I call http://dev.domain.tld, all links point to http://domain.tld, which should not be.

      But if I call a page beyond the top page by typing it manually into the browser (i.e. http://dev/domain.tld/section1.html), all links in the menu point to http://dev.domain.tld/...

      Kinda strange. BTW, the navigation is wayfinder.

      Any clues?

      Cheers,
      Frisco
        • 10190
        • 187 Posts
        I solved by deleting

        <base href="[(site_url)]"/>


        from the head section of the template. Don’t know anymore why I put it there, it was recommended to me some years ago.

        Hope the rest of the site will work without this.

        Cheers
        Frisco