From 2b5584b223a087e7f66cdb3748812eb4c0e3112e Mon Sep 17 00:00:00 2001 From: October Date: Wed, 30 Jul 2014 13:22:34 +0800 Subject: [PATCH] support nginx rewrite --- engine/lib/Url.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/lib/Url.class.php b/engine/lib/Url.class.php index 7ee4b64..b4405a7 100755 --- a/engine/lib/Url.class.php +++ b/engine/lib/Url.class.php @@ -83,7 +83,9 @@ class Url{ $custom = array(); if( !self::$url ){ if( c('static_url') ){ - self::$url = isset($_SERVER['REDIRECT_URL'])&&$_SERVER['REDIRECT_URL']?$_SERVER['REDIRECT_URL']:$_SERVER['PATH_INFO']; + //self::$url = isset($_SERVER['REDIRECT_URL'])&&$_SERVER['REDIRECT_URL']?$_SERVER['REDIRECT_URL']:$_SERVER['PATH_INFO']; + self::$url = trim( current( explode('?', $_SERVER['REQUEST_URI'])), '/' ); + self::$url = ltrim( self::$url, trim( self::URLBASE , '/' ) ); }else{ self::$url = $_GET; }