diff --git a/index.php b/index.php index 0c2c215..a42a84e 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,10 @@ if (!empty($_GET['url'])) { mkdir($hashfolderpath, 0700, true); file_put_contents($hashfilepath, $url); - $content = 'http://'.$_SERVER['HTTP_HOST'].'/?'.$urlhash.''; + + $shortUrl = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['SCRIPT_NAME'].'?'.$urlhash; + + $content = ''.$shortUrl.''; } elseif (!empty($_GET)) { $urlhash = key($_GET);