diff --git a/src/Libs/Router.php b/src/Libs/Router.php index 38c3187..24cdbab 100644 --- a/src/Libs/Router.php +++ b/src/Libs/Router.php @@ -100,7 +100,7 @@ class Router { */ public static function redirect(string $path): void { - header('Location: '.static::basePath().substr($path,1)); + header('Location: '.static::basePath().ltrim($path, '/')); exit; } diff --git a/src/Libs/View.php b/src/Libs/View.php index 9f878ba..a6de24f 100644 --- a/src/Libs/View.php +++ b/src/Libs/View.php @@ -156,7 +156,7 @@ class View extends Neuron { public function route(string $path = '/'): string { if (defined('SITE_URL') && !empty(SITE_URL)) - return SITE_URL.substr($path,1); + return SITE_URL.ltrim($path, '/'); return $path; }