alias a subdomain to a subdomain(vhost)

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

  1. nhybgtvfr

    nhybgtvfr Active Member

    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 2nd-language.com is an aliasdomain to 1st-language.com, 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, dev.domain.com, 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 dev.2nd-language.com, in clients - domains, so it can be assigned directly. but i can't alias it to dev.domain.com, as the process see's the parent domain as domain.com, not dev.domain.com, 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 dev.domain.com site, remove that subdomain and create dev.domain.com as a full separate website, and then aliasdomain dev.2nd-language.com to dev.domain.com?
     
  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 Active Member

    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 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

    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 Active Member

    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.

    done.
     
  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 Active Member

    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