diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-14 18:37:23 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-14 18:37:23 +0000 |
commit | d27572e839f8f5d035471ce79aa2c2797b9bd086 (patch) | |
tree | b36eb1bdfce77e483a21bcfbf305b7e00da06840 | |
parent | 8d8ef28e499b5433c6438e88260a39daccc99f62 (diff) | |
download | elgg-d27572e839f8f5d035471ce79aa2c2797b9bd086.tar.gz elgg-d27572e839f8f5d035471ce79aa2c2797b9bd086.tar.bz2 |
Fixes #3080: Move redirect code to before engine inclusion
git-svn-id: http://code.elgg.org/elgg/trunk@8702 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/handlers/page_handler.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/handlers/page_handler.php b/engine/handlers/page_handler.php index 491a1b200..1ed295b7d 100644 --- a/engine/handlers/page_handler.php +++ b/engine/handlers/page_handler.php @@ -28,16 +28,18 @@ * @link http://docs.elgg.org/Tutorials/PageHandlers */ -require_once(dirname(dirname(__FILE__)) . "/start.php"); -$url = current_page_url(); -$new_url = preg_replace('#/pg/#', '/', $url); +// Permanent redirect to pg-less urls +$url = $_SERVER['REQUEST_URI']; +$new_url = preg_replace('#/pg/#', '/', $url, 1); if ($url !== $new_url) { header("HTTP/1.1 301 Moved Permanently"); header("Location: $new_url"); } +require_once(dirname(dirname(__FILE__)) . "/start.php"); + $handler = get_input('handler'); $page = get_input('page'); |