alias a subdomain to a subdomain(vhost)

Discussion in 'General' started by nhybgtvfr, Sep 11, 2020.

  1. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok. got a confusing one here.
    the problem: a wordpress site wants to use a different domainname for a different language using wpml
    normally, that's fine, i just create it as an aliasdomain to the original site with no redirection configured. eg is an aliasdomain to, and wordpress and the wpml plugin handles all of the tricky language redirection stuff.

    now we've got a site where we're trying to do some major redevelopment, so i created a subdomain vhost,, with a path /dev
    which was fine, it was a single language site, the development work could start.
    they now want to make it a multi-lingual site. so i need to sort it that out in dev first.
    but how do i aliasdomain a subdomain to a vhost subdomain? i can't see any way to do it in ispconfig.
    i can create the domain as, in clients - domains, so it can be assigned directly. but i can't alias it to, as the process see's the parent domain as, not, so the alias would get applied to the wrong vhost.

    surely, when aliasing (or adding a subdomain to) a domain, the drop-down list for parent website should list every available vhost, including subdomain(vhosts) not just the top level domain?

    am i correct in assuming that the only way i can do this now is to backup the current site, remove that subdomain and create as a full separate website, and then aliasdomain to
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Instead of using a vhost subdomain for the dev site, it would have been better to create a new site and enter dev.clientdomain.tld in the domain field. I always do it that way and the additional benefit is, the dev site can't mess up the production site plus you can later simply alter the domain name of the dev site to make it the production site when the new site shall go live.
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    yeah, kinda figured i'd have to do it that way.
    shame really. if we could choose any existing vhost from the parent website dropdown it would mean the alias gets included in the subdomains vhost config file without needing a whole new complete web folder structure, and as a separate vhost to the top domain, they shouldn't be able to mess up the production site unless they upload the files to the wrong folder. besides, i wouldn't put it past most of our end users to use the wrong ftp account and do that anyway. :(
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    And that's what tends happens when a design agency works on your site :) That's why I would always choose a separate site with separate FTP login for that.
  5. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    This is an oversight, fixed in 3.1dev a while back - you should pick a different path for your subdomain.

    As to your current scenario, i believe you can just add another subdomain vhost and set the path to the same as the first one to achieve what you wanted. It do subdomain paths have to be unique? (I can't test right now.)

    You could make a feature request for that (as subdomain and alias vhosts to the select list).
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    I don't think another subdomain will help as this is for WPMU which in my experience will need to use alias to work, however, his own suggestion should work.
  7. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    not sure what the oversight here is. i've created a vhostsudomain with the webfolder /dev and that works fine. no noticeable problem with that, unless i'm missing something?

    i think i've done that before (same subdomain paths), not 100% sure though, i'll give it a try on my test server. not sure if having them as different vhosts will cause any issues with wordpress using different domains and XSS or CORS, i like to keep them blocked for anything other than sameorigin.

  8. till

    till Super Moderator Staff Member ISPConfig Developer

    the directory /dev is a Linux system folder and as soon as you activate a jail, either for an ssh user or a cronjob, /dev in the web directory becomes /dev in the jail and applications in the jail will start to fail and the jail will not work.
    ahrasis likes this.
  9. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    damn... very good point. can't believe i didn't notice or think of that... :oops:
    good job i've not used ssh or cron on that site yet then...
    now, if you'll excuse me, i seem to suddenly have a subdomain vhost to relocate... :p

Share This Page