Document root Magento with several domains.

Discussion in 'General' started by aqualimon, Nov 15, 2016.

  1. aqualimon

    aqualimon New Member

    Hi
    I have a Ubuntu 16.04 with ISPconfig 3. I have created an client witch is going to have a magento installation with multiple country domains for different languages.

    When checking google it is suggested to change the document root for the other domains to folder of magento installation togather with some settings in .htaccess.

    How ever when I set document root of client1/web2 for example to client1/web1 I get 403 forbidden when trying to access the domain for web2. DocumentRoot /var/www/clients/client1/web1 under Options

    I have chown www-data for client1/web1

    What else is blocking this access?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The approach that you fund in google is not for ispconfig. In ispconfig, this is way easier. All you have to do is to add the other domains as alias or subdomains in ispconfig, no paths need to be changed and do not add a website for the other domains.
     
  3. aqualimon

    aqualimon New Member

    Hi Thanks for your reply.

    I tried to just configure the alias.

    But the problem is if i configure an alias ex domain.com --> domain.eu I want the domain.com just to use the domain.eu folder i do not want the domain to change to domain.eu in the browser.

    Ex shop is installed on
    domain.eu

    if user uses domain.com this is what should be shown in browser. But with the .htaccess it should pick the correct storeview ofcourse.
     
  4. aqualimon

    aqualimon New Member

    I have googled some more and of what i can see i need to accomplish to share the folder of the store installation
    With DocumentRoot
    Or by use of symlinks.

    But i can not get it to work any one done this with ispconfig. I have seen some example with plesk where they change the domain folder.
    domain.com --> /var/www/client/client1/web1/web USER web1
    domain.eu --> /var/www/client/client1/web1/web USER web2

    Is there a way to make some modifications in Ispconfig? Its just my own private vps so i dont care about security between the diffrent domains as it will only be this on the server.
     
  5. Jesse Norell

    Jesse Norell Active Member

    In your website alias settings, use Redirect Type: No redirect and SEO Redirect: No redirect.
     
  6. aqualimon

    aqualimon New Member

    Hi
    It ends up in a redirect loop.

    ERR_TOO_MANY_REDIRECTS

    I did as according to magento documentation with out the sharing of folder but with the alias instead.
    http://devdocs.magento.com/guides/v2.0/config-guide/multi-site/ms_apache.html

    Example
    Shop is installed on domain.eu
    Here is the loop scenario.
    User uses domain.com -->With Ispconfig alias setting --> domain.eu(shop install) --> magento domain rewrite .htaccess --> domain.com

    I suppose the use of alias with domain rewrite is not working.
     
  7. aqualimon

    aqualimon New Member

    It seems the multiple redirect issue was a browser cashe issue when cleaning it the error dissapears.

    But now the site dosent recocnize the domain alias instead it just presents the target website.

    Can i some how change the User ex web1 web2 for a website? This way i could share the folders easlily between the domains.

    What i want to accomplish is.
    domain.com user web1
    domain.eu user web1
     
  8. Jesse Norell

    Jesse Norell Active Member

    An alias domain is what you want, it points both names at the same document root. More specifically, it creates a single VirtualHost entry in the webserver config with a ServerName and ServerAlias entry, so there is only a single vhost definition, and hence both domain names must have the same document root. If you have your second domain as a different web user, you did not create an alias domain. (I believe this is new in ispconfig 3.1, it's under Sites > Aliasdomain for website)
     

Share This Page