diff --git a/index.php b/index.php
index 0fb05be..7d208e4 100644
--- a/index.php
+++ b/index.php
@@ -32,9 +32,15 @@ if (!empty($_GET['url'])) {
$shortUrl = $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'].'?'.$urlhash;
+ if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') {
+ $shortUrl = 'https://'.$shortUrl;
+ } else {
+ $shortUrl = 'http://'.$shortUrl;
+ }
+
$qrcode = (new QrCode())->setText($shortUrl);
- $content = ''.$shortUrl.'
'
+ $content = ''.$shortUrl.'
'
.'
';
} elseif (!empty($_GET)) {
$urlhash = key($_GET);