diff --git a/.ci/generateIndex.py b/.ci/generateIndex.py
index af7705de4da68becdb044958ba895f3b9293cfd1..bb89738881c974bef2b2bfa65fb866afa410e958 100644
--- a/.ci/generateIndex.py
+++ b/.ci/generateIndex.py
@@ -20,6 +20,9 @@ def build_link(title, href):
     elif ('handbook-annexes' in href):
         href = href.replace('handbook-annexes', 'handbook').strip()
 
+    # add relative url
+    href = "{{ '" + href + "' | relative_url }}"
+
     return f'\t\t\t<li><a href="{href}">{title}</a></li>\n'
 
 def build_section_start(title, shortcut):
@@ -198,8 +201,8 @@ for s in sections:
 index += "\n</div>"
 
 ## add link to return to main index
-index += "<br><center><a href='/'>go back</a></center>"
-index += "<br><center><a href='/cards'>Overview of all HowTo cards</a></center>"
+index += """<br><center><a href="{{ '/' | relative_url }}">go back</a></center>"""
+index += """<br><center><a href="{{ '/cards' | relative_url }}">Overview of all HowTo cards</a></center>"""
 
 # output the index
 #print(index)
diff --git a/index.md b/index.md
index 9679e0c9bcb45640c232754bc8fe1c00fc041bb6..b81e563d9624da0f4bb5447270ff3e74039d1ac5 100644
--- a/index.md
+++ b/index.md
@@ -15,37 +15,37 @@ The How-to cards are intended to provide practical guidance in implementing Data
             "title": "General",
             "caption": "I need information on LCSB operations",
             "icon": "<i class=\"large material-icons\">sticky_note_2</i>",
-            "link": "/cards#general"
+            "link": "{{ '/cards#general | relative_url }}"
         },
         {
             "title": "Access",
             "caption": "How can I get access to systems and infrastructure?",
             "icon": "<i class=\"large material-icons\">login</i>",
-            "link": "/cards#access"
+            "link": "{{ '/cards#access | relative_url }}"
         },
         {
             "title": "Contribute",
             "caption": "I want to share my knowledge and expertise. How?",
             "icon": "<i class=\"large material-icons\">add_circle</i>",
-            "link": "/cards#contribute"
+            "link": "{{ '/cards#contribute | relative_url }}"
         },
         {
             "title": "Exchange channels",
             "caption": "I am looking to share data or information",
             "icon": "<i class=\"large material-icons\">multiple_stop</i>",
-            "link": "/cards#exchange-channels"
+            "link": "{{ '/cards#exchange-channels | relative_url }}"
         },
         {
             "title": "Integrity",
             "caption": "I want to ensure that my work and research is compliant and reusable",
             "icon": "<i class=\"large material-icons\">vpn_key</i>",
-            "link": "/cards#integrity"
+            "link": "{{ '/cards#integrity | relative_url }}"
         },
         {
             "title": "Lab",
             "caption": "I need information on wetlab equipment and procedures",
             "icon": "<i class=\"large material-icons\">science</i>",
-            "link": "/cards#lab"
+            "link": "{{ '/cards#lab | relative_url }}"
         },
     ];