diff --git a/src/Libs/Router.php b/src/Libs/Router.php index 24cdbab..5f23af9 100644 --- a/src/Libs/Router.php +++ b/src/Libs/Router.php @@ -83,7 +83,7 @@ class Router { public static function basePath(): string { if (defined('SITE_URL') && !empty(SITE_URL)) - return parse_url(SITE_URL, PHP_URL_PATH); + return rtrim(parse_url(SITE_URL, PHP_URL_PATH), '/').'/'; return str_replace($_SERVER['DOCUMENT_ROOT'], '/', ROOT_DIR); } diff --git a/src/Libs/View.php b/src/Libs/View.php index a6de24f..8a1774d 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.ltrim($path, '/'); + return rtrim(SITE_URL, '/').'/'.ltrim($path, '/'); return $path; }