1

Probably this one is repeated, but I couldn't find an answer for it yet.

I have a multi-site in Craft CMS 3.15, one that is in English and another one in Japanese.

So the English page, which is the default, is www.mysite.com, and my other site, is working fine if the domain is www.mysite.com/jp

However, I want to change the domain for the Japanese site to be www.myjapanesesite.com/home and is not working as I expected as the browser says that there have been too many redirects.

How can I make this possible on Craft? Is there anything else I should config in Craft or in the htaccess file?

The redirects section from my htaccess looks like this:

<IfModule mod_rewrite.c>
   RewriteEngine On

   RewriteCond %{HTTP:X-Forwarded-Proto} !https
   RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

   RewriteRule ^(autodiscover) - [L]
   
   RewriteCond %{HTTP_HOST} !mysite.com$ [NC]
   RewriteRule ^(.*)$ https://www.mysite.com/$1 [L,R=301]

   RewriteCond %{HTTP_HOST} !^www. [NC]
   RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

   # Send would-be 404 requests to Craft
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
   RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>

While the Base URL for my English site is https://www.mysite.com and the Japanese one is https://www.mysite.com/jp (I have tried to change it to www.myjapanesesite.com/home but that's when it doesn't work).

Thanks in advance

Note: I have set the alias for this site www.myjapanesesite.com in SiteHost (the hosting service)

1 Answer 1

2

I believe you need to use tweak the config/general.php file in order to have a baseUrl for a site that is a different domain name.

'siteUrl' => [
    'english' => 'https://www.mysite.com/',
    'japanese' => 'https://www. myjapanesesite.com/',
],

See documentation at: https://docs.craftcms.com/api/v3/craft-config-generalconfig.html#siteurl

1
  • Great!! Thanks for the answer. Now it is working fine if I go to myjapanesesite.com/home it takes me to the landing page. If i just go to myjapanesesite.com/ it takes me to the English site though.. Commented Dec 9, 2020 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.