]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Redirect websites landing pages
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 24 Dec 2019 13:00:21 +0000 (14:00 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 24 Dec 2019 13:00:21 +0000 (14:00 +0100)
modules/private/websites/chloe/production.nix
modules/private/websites/ludivinecassal/production.nix
modules/private/websites/piedsjaloux/production.nix

index 3d267f2494595774004608769ddd7f60d028c926..578bf918cab22fecc52798a546560d1d731a3965 100644 (file)
@@ -33,7 +33,14 @@ in {
       certMainHost = "osteopathe-cc.fr";
       hosts        = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
       root         = chloe.apache.root;
-      extraConfig  = [ chloe.apache.vhostConf ];
+      extraConfig  = [
+        ''
+          RewriteEngine On
+          RewriteCond "%{HTTP_HOST}" "!^www\.osteopathe-cc\.fr$" [NC]
+          RewriteRule ^(.+)$ https://www.osteopathe-cc.fr$1 [R=302,L]
+          ''
+        chloe.apache.vhostConf
+      ];
     };
     services.websites.env.production.watchPaths = [
       "/var/secrets/webapps/${chloe.app.environment}-chloe"
index c6f0cf3d23c8071e804f4a47afde617e95f48a5d..7cf00f0d797a7a62c5edf3222ba15a7298d68e87 100644 (file)
@@ -85,6 +85,10 @@ in {
       root         = pcfg.webappDirs.ludivinecassal_prod;
       extraConfig  = [
         ''
+        RewriteEngine on
+        RewriteCond "%{HTTP_HOST}" "!^ludivinecassal\.com$" [NC]
+        RewriteRule ^(.+)$ https://ludivinecassal.com$1 [R=302,L]
+
         <FilesMatch "\.php$">
           SetHandler "proxy:unix:${pcfg.phpListenPaths.ludivinecassal_prod}|fcgi://localhost"
         </FilesMatch>
index 28f85eb180474318204000dc6e4004bd00dd1876..e4e29c710d29f2ce242088e8f99ffca17dfeea04 100644 (file)
@@ -74,6 +74,10 @@ in {
       root         = pcfg.webappDirs.piedsjaloux_prod;
       extraConfig  = [
         ''
+        RewriteEngine on
+        RewriteCond "%{HTTP_HOST}" "!^www.piedsjaloux\.fr$" [NC]
+        RewriteRule ^(.+)$ https://www.piedsjaloux.fr$1 [R=302,L]
+
         <FilesMatch "\.php$">
           SetHandler "proxy:unix:${pcfg.phpListenPaths.piedsjaloux_prod}|fcgi://localhost"
         </FilesMatch>