From d1b139bb30d1c7a42e31be29ca6f0ae6db1f0a94 Mon Sep 17 00:00:00 2001 From: Loic d'Anterroches Date: Mon, 16 Feb 2009 22:18:09 +0100 Subject: [PATCH] Better redirection to have canonical URLs. --- src/IDF/Views/Source.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index dade5bc..9b89407 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -159,6 +159,10 @@ class IDF_Views_Source $branches[0])); if (substr($request_file, -1) == '/') { $request_file = substr($request_file, 0, -1); + $url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::tree', + array($match[1], $match[2], + $request_file)); + return new Pluf_HTTP_Response_Redirect($url, 301); } if ('commit' != $scm->testHash($commit, $request_file)) { // Redirect to the first branch