From fc10a50ca301b4c56c237ae4708bb6e885b51799 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Thu, 19 Jul 2012 08:27:52 +0000 Subject: [PATCH] Fixed redirect problem when running in a subfolder --- flight/Flight.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/flight/Flight.php b/flight/Flight.php index 6bfc0a7..b8b782e 100644 --- a/flight/Flight.php +++ b/flight/Flight.php @@ -365,6 +365,11 @@ class Flight { * @param string $url URL */ public static function _redirect($url, $code = 303) { + $base = self::request()->base; + if ($base != '/' && strpos($url, '://') === false) { + $url = $base.(($url[0] == '/') ? '' : '/').$url; + } + self::response(false) ->status($code) ->header('Location', $url)