aliasdomain to subfolder

Discussion in 'ISPConfig 3 Priority Support' started by aldo, Sep 1, 2016.

  1. aldo

    aldo Member HowtoForge Supporter

    I trying to redirect an aliasdomain to subfolder of an existing domain (site) but I have two problems.
    Example
    Main domain: domain1.tld
    Alias domain: domain2.tld
    Root of domain1.tld is [path_of_main_site]/web/
    Root of domain2.tld is [path_of_main_site]/web/subfolder/
    Alias domain website uses resources (images and DB) of the main website.
    Browsing http://domain1.tld is ok
    Browsing http://domain1.tld/subfolder/ is ok

    First problem
    Browsing http://domain2.tld you are redirected to http://domain2.tld/subfolder/
    Is it possible to hide "subfolder/" from URL?

    Second problem (I solved this problem with a symlink; so please ignore it if doesn't exist a better way)
    The site of domain2.tld uses images located in [path_of_main_site]/web/images/ with href like ../images/portfolio/image1.jpg
    and the images are not shown.
    Is there a way to refer to the images folder?

    Thanks.
     
    Last edited: Sep 1, 2016
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    One option would be to use a vhost aliasdomain, but that's available in ISPConfig 3.1 only.
    Another option which works with ISPConfig 3.0.5 is to set a custom reqrite rule in the .htaccess file of the website like this: http://stackoverflow.com/questions/10457207/redirect-to-another-domain-but-keep-the-url

    Using a symlink is a good option here in my opinion.
     

Share This Page