Create Grav multi domain setup

Discussion in 'Installation/Configuration' started by Dennis_sp, Aug 20, 2019.

  1. Dennis_sp

    Dennis_sp Member

    Hi,

    I'm using getgrav.org for creating two online manuals, one in Dutch the other in English. I have created two domains for this:
    xxx.nl
    yyy.com
    I'm using the translation feature of Grav, that means each page has two versions and by placing /nl or /en at the end of the URL you will get your language. According to the Grav documentation you can create rewrite rules that point you to the right language based on the URL:
    https://learn.getgrav.org/16/content/multi-language#setup-with-language-specific-domains

    I have a domain in ISPconfig that points to the xxx.nl site and i have an alias called yyy.com pointing to the xxx.nl site.
    I have placed the rewrite rules in the xxx.nl Options>Apache directives tab:

    Code:
    # handle top level e.g. https://xxx.nl/nl
    RewriteRule ^nl/?$ "https://xxx.nl" [R=302,L]
    RewriteRule ^en/?$ "https://yyy.com" [R=302,L]
    
    # handle sub pages, exclude admin path
    RewriteCond %{REQUEST_URI} !(admin) [NC]
    RewriteRule ^nl/(.*)$ "https://xxx.nl/$1" [R=302,L]
    RewriteCond %{REQUEST_URI} !(admin) [NC]
    RewriteRule ^en/(.*)$ "https://yyy.com/$1" [R=302,L]
    However when i go to yyy.com it still points to the default language and shows this url: yyy.com/nl instead of /en.
    Did i set this up correctly in ISPConfig or is this a Grav issue?
     
  2. ahrasis

    ahrasis Well-Known Member

    I think the software only deals with a single domain but multiple language folders but I could be wrong.
     
  3. Jesse Norell

    Jesse Norell Well-Known Member

    On the ISPConfig side, try creating yyy.com as a vhost alias domain.
     

Share This Page