From de505d3845de658d1d7c872042c8c49a9766e55c Mon Sep 17 00:00:00 2001 From: Sajeyks Date: Tue, 3 Nov 2026 13:51:09 +0300 Subject: [PATCH] Serve alias hosts instead of redirecting them to the site's canonical domain --- dynamicweb/management/commands/migrate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dynamicweb/management/commands/migrate.py b/dynamicweb/management/commands/migrate.py index 97eacbcc..7644ee1b 100644 --- a/dynamicweb/management/commands/migrate.py +++ b/dynamicweb/management/commands/migrate.py @@ -55,7 +55,9 @@ class Command(migrate.Command): for domain in json.loads(os.environ.get('UNGLEICH_SITE_CONFIGS') or '{}'): Site.objects.get_or_create(domain=domain, defaults={'name': domain}) for alias, domain in json.loads(os.environ.get('UNGLEICH_SITE_ALIASES') or '{}').items(): - Alias.objects.get_or_create(domain=alias, defaults={'site': Site.objects.get(domain=domain)}) + # no redirect to the site's canonical domain: the alias host is to be served + Alias.objects.update_or_create(domain=alias, defaults={ + 'site': Site.objects.get(domain=domain), 'redirect_to_canonical': False}) @staticmethod def cms_tree_done():