startsWith($uri, "/introduction") || $this->startsWith($uri, "/invitation")) { $this->code = 301; $this->newUri = "/"; $this->done = TRUE; } if ($this->startsWith($uri, "/video")) { $this->code = 301; $this->newUri = "/?filter=Video"; $this->done = TRUE; } if ($this->startsWith($uri, "/news")) { $this->code = 301; if (isset($_REQUEST["itemId"])) $this->newUri = "/?galleryId=".$_REQUEST["itemId"]."&action=show"; else $this->newUri = "/"; $this->done = TRUE; } if ($this->startsWith($uri, "/365") || $this->startsWith($uri, "/photostream")) { $this->code = 301; $this->newUri = "/?galleryId=106&action=show"; $this->done = TRUE; } if ($this->startsWith($uri, "/photogallery") || $this->startsWith($uri, "/photojournal") || $this->startsWith($uri, "/photoblog") || $this->startsWith($uri, "/photoindex") || $this->startsWith($uri, "/photorindex") || $this->startsWith($uri, "/photocalendar") || $this->startsWith($uri, "/photogalleryview") || $this->startsWith($uri, "/photoview") || $this->startsWith($uri, "/photo") ) { $this->code = 301; if (isset($_REQUEST["Gallery"])) $this->newUri = "/?galleryId=".$_REQUEST["Gallery"]."&action=show"; if (isset($_REQUEST["Photo"])) $this->newUri = "/?photoId=".$_REQUEST["Photo"]."&action=show"; if (!isset($_REQUEST["Gallery"]) && !isset($_REQUEST["Photo"])) $this->newUri = "/"; $this->done = TRUE; } if ($this->startsWith($uri, "/cv")) { $this->code = 301; $this->newUri = "/sk/Text/cv"; $this->done = TRUE; } /*if ($this->startsWith($uri, "/contact")) { $this->code = 301; $this->newUri = "/?section=cv&action=text&presenter=Richtext"; $this->done = TRUE; }*/ if ($this->startsWith($uri, "/slovnik")) { $this->code = 301; $this->newUri = "/?galleryId=16&action=show"; $this->done = TRUE; } if ($this->startsWith($uri, "/gallery")) { $this->code = 301; $this->newUri = "/gallery/". $_REQUEST["Gallery"] ."/" . (($_REQUEST["PGFormat"] == "full") ? "" : $_REQUEST["PGFormat"] . "_") . $_REQUEST["PGView"] . ".jpg"; //echo $this->newUri; $this->done = TRUE; } if ($this->startsWith($uri, "/login")) { $this->code = 301; $this->newUri = "/sk/sign/in"; $this->done = TRUE; } if (!$this->done) { if (isset($_REQUEST["new_slice_id"]) && ($_REQUEST["new_slice_id"] == "5")) { if (isset($_REQUEST["PGCommand"]) && ($_REQUEST["PGCommand"] == "gallery")) { $this->code = 301; if (isset($_REQUEST["Gallery"])) $this->newUri = "/?galleryId=".$_REQUEST["Gallery"]."&action=show"; if (isset($_REQUEST["Photo"])) $this->newUri = "/?photoId=".$_REQUEST["Photo"]."&action=show"; if (!isset($_REQUEST["Gallery"]) && !isset($_REQUEST["Photo"])) $this->newUri = "/"; } } } } public function redirect() { switch ($this->code) { case 301: header("HTTP/1.1 301 Moved Permanently"); header("Location: ". $this->site . $this->newUri); break; default: header("HTTP/1.1 503 Service Unavailable"); break; } } public function dump() { return "Code = '$this->code' URI = '". $this->site . $this->newUri . "'"; } } $red = new WRaCompRedirector(); $red->process($_SERVER["REQUEST_URI"]); $red->redirect(); ?>