diff --git a/bin/noblogs.in b/bin/noblogs.in
index 13302a8910076341e3259e5df3ff0d651018caf7..91c2f2e08b49ffb579294f6a1b5408b4b0a115ed 100755
--- a/bin/noblogs.in
+++ b/bin/noblogs.in
@@ -440,7 +440,7 @@ function do_ngg_convert($args) {
 
 // replaces http with https, and removes ending slash
 function add_https_to_uri($uri){
-    $re = "http[s]?:\/\/([^.]+\.noblogs\.org)[/]?/i";
+    $re = "#^http[s]?://([^.]+\.noblogs\.org)[/]?$#i";
     $subst = "https://$1";
     return preg_replace($re,$subst,$uri);
 }