diff --git a/main.py b/main.py
index 834250b2b3a2df5b0e67eb0a029edba43fafbbec..4378e552b2e6ded9f8191a1d88c9413793bfbe83 100644
--- a/main.py
+++ b/main.py
@@ -160,7 +160,7 @@ def redirectOwnLinks():
 
 @app.route('/user/links<pageNumber>')#This function gives the user the posibility to see and delete his links
 def ownLinks(pageNumber):
-    return userProfile(request, cookieNotice, s, pageNumber)
+    return userProfile(request, cookieNotice, s, pageNumber, url_scheme)
 
 @app.route('/user/delete') #This function is called if a user deletes an entrie
 def delete():
diff --git a/userprofile.py b/userprofile.py
index 5afe9afe3716edb67f2402fbe831ff3f4b9b2eb4..718097359f1a636f608e789750c34524a0fd7a9f 100644
--- a/userprofile.py
+++ b/userprofile.py
@@ -2,7 +2,7 @@ import sqlite3
 from flask import redirect, abort, render_template
 from html import escape #This is used to escape characters, if they are send in the url
 
-def userProfile(request, cookieNotice, s, pageNumber):
+def userProfile(request, cookieNotice, s, pageNumber, url_scheme):
     backButton = 0
     nextButton = 0
     lenEntries = 0
@@ -32,7 +32,7 @@ def userProfile(request, cookieNotice, s, pageNumber):
                     calls = str(cursor2.execute('SELECT CALLS FROM ANALYTICS WHERE SHORT_URL=?', [entries[1]]).fetchone()[0])
                 except:
                     calls = "0"
-                response = response + "<tr>\n<td>" + entries[0] + "</td>\n<td><a href=\"" + entries[1] + '">' + entries[1] + '</a></td>\n<td>' + calls + '</td>\n<td><a id="red" href="/user/delete?link=' + escape(entries[1]) + '">delete</a> <a href="#" id="dialog-link" onclick="buttonListener(\'' + entries[1] + '\', this)">QR</a></tr>\n'
+                response = response + "<tr>\n<td>" + entries[0] + "</td>\n<td><a href=\"" + url_scheme + "://" + entries[1] + '">' + entries[1] + '</a></td>\n<td>' + calls + '</td>\n<td><a id="red" href="/user/delete?link=' + escape(entries[1]) + '">delete</a> <a href="#" id="dialog-link" onclick="buttonListener(\'' + entries[1] + '\', this)">QR</a></tr>\n'
             response = response + "</table>" #Close the table
 
             if(len(entriesList) == 0): response = 'you have no shorten links.' #If user has no shorten links make this message