diff --git a/.ci/.autoRedirect b/.ci/.autoRedirect
index 1c7bfc532cd669559bd5fd33796e543af631230e..d18e26b4299d6db22589b472e85bd92454cbb46d 100644
--- a/.ci/.autoRedirect
+++ b/.ci/.autoRedirect
@@ -15,12 +15,22 @@
         });
     }
     UrlExists('https://r3-core.pages.uni.lu/howto-cards-internal/index.html', function(status){
+        var s = window.location.pathname;
+        var pathArray = s.split('/');
+
+        // cut the entire subdomain path
+        if (pathArray[0].length > 0) {
+            sub = s.substr(pathArray[0].length+1);
+        } else {
+            sub = '';
+        }
+
         if(status === 200){
             // internal pages
-            window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable';
+            window.location.href = 'https://r3-core.pages.uni.lu/howto-cards-internal/stable/internal/'+sub;
         } else {
             // external pages
-            window.location.href = 'https://r3.pages.uni.lu/howto-cards/stable';
+            window.location.href = 'https://r3.pages.uni.lu/howto-cards/stable/external/'+sub;
         }
     });
     </script>