From da74156ca8df73725cba21459052e4561a005f45 Mon Sep 17 00:00:00 2001 From: Egor Savkin Date: Wed, 4 Dec 2024 16:55:36 +0800 Subject: [PATCH] Reduce websites duplication Redirect www.* URLs to non-www.* with default 301 code in order to reduce number of copies of the websites in search engines Signed-off-by: Egor Savkin --- nixbld-etc-nixos/configuration.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index a880162..6f530f2 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -1044,9 +1044,17 @@ in }; in { "m-labs.hk" = mainWebsite; - "www.m-labs.hk" = mainWebsite; + "www.m-labs.hk" = { + addSSL = true; + enableACME = true; + globalRedirect = "m-labs.hk"; + }; "m-labs.ph" = mainWebsite; - "www.m-labs.ph" = mainWebsite; + "www.m-labs.ph" = { + addSSL = true; + enableACME = true; + globalRedirect = "m-labs.ph"; + }; "nixbld.m-labs.hk" = { forceSSL = true; enableACME = true; @@ -1193,7 +1201,7 @@ in "www.193thz.com" = { addSSL = true; enableACME = true; - root = "/var/www/193thz"; + globalRedirect = "193thz.com"; }; "nmigen.net" = { addSSL = true; @@ -1203,7 +1211,7 @@ in "www.nmigen.net" = { addSSL = true; enableACME = true; - root = "${hydraWwwOutputs}/nmigen-docs"; + globalRedirect = "nmigen.net"; }; }; }; -- 2.47.0