diff --git a/united4earth/static/js/main.js b/united4earth/static/js/main.js
index f200c3cb3971d8165fa4be7e5ffee73f3bdf4790..3c96f339ee882c9dff9aa363cacdba59c2f1d6d8 100644
--- a/united4earth/static/js/main.js
+++ b/united4earth/static/js/main.js
@@ -588,9 +588,9 @@ function socialMediaShare(self){
         //console.log("share text",shareText)
   
         //set home url
-        let currentPageUrl = location.host + document.querySelector('solid-display-value[name="shortLink.shortLink"]').textContent;
+        let currentPageUrl = location.origin + document.querySelector('solid-display-value[name="shortLink.shortLink"]').textContent;
         
-        if (currentPageUrl == location.host) {
+        if (currentPageUrl == location.origin) {
           currentPageUrl = location.href;
         }