Author: nextgens
Date: 2008-05-08 10:23:19 +0000 (Thu, 08 May 2008)
New Revision: 19838

Modified:
   trunk/website/includes/common.inc.php
Log:
website: try to get rid of old urls

Modified: trunk/website/includes/common.inc.php
===================================================================
--- trunk/website/includes/common.inc.php       2008-05-08 09:33:29 UTC (rev 
19837)
+++ trunk/website/includes/common.inc.php       2008-05-08 10:23:19 UTC (rev 
19838)
@@ -1,5 +1,23 @@
 <?php

+if (!isset($_REQUEST["rewritten"])) {
+        $currentURI = htmlentities($_SERVER['REQUEST_URI']);
+        $host = htmlentities($_SERVER['HTTP_HOST']);
+        $prefix = "http://".$host;
+                                                            
+        if ($c=preg_match_all ("/\\/index\\.php\\?page=([^&]+)/is", 
$currentURI, $matches)) {
+                $page_name = $matches[1][0].".html";
+        } else {          
+                $page_name = "";
+        }                               
+        $newURI = $prefix.'/'.$page_name;
+
+        header("Request-URI: $newURI");
+        header("Content-Location: $newURI");
+        header("Location: $newURI");
+        die;
+} 
+
 function setLanguage() {
        global $lang;



Reply via email to