Changeset 812 for trunk/Modules


Ignore:
Timestamp:
May 31, 2014, 9:35:15 AM (10 years ago)
Author:
chronos
Message:
  • Fixed: "Page not found" was not handled correctly. It was handled incorrectly by Redirection module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Redirection/Redirection.php

    r807 r812  
    2020  }
    2121
     22  function Redirect($Location)
     23  {
     24        Header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently');
     25    Header('Location: '.$Location);
     26    return('<h3 align="center">Požadovaná stránka byla přesunuta do nového umístění.</h3>');
     27  }
     28
    2229  function ShowRedirect()
    2330  {
    24     Header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently');
     31    $Output = '';
    2532    if(count($this->System->PathItems) > 0)
    2633    {
    27         if($this->System->PathItems[0] == 'team.php') Header('Location: '.$this->System->Link('/team/'));
    28       if($this->System->PathItems[0] == 'version.php') Header('Location: '.$this->System->Link('/client-version/'));
    29       if($this->System->PathItems[0] == 'phpBB3') Header('Location: '.$this->System->Link('/forum/'));
    30       if($this->System->PathItems[0] == 'phpbb3') Header('Location: '.$this->System->Link('/forum/'));
    31       if($this->System->PathItems[0] == 'statistic.php') Header('Location: '.$this->System->Link('/progress/'));
    32       if($this->System->PathItems[0] == 'register.php') Header('Location: '.$this->System->Link('/registrace.php'));
    33       if($this->System->PathItems[0] == 'dictionary.php') Header('Location: '.$this->System->Link('/dictionary/'));
    34       if($this->System->PathItems[0] == 'download-addon.php') Header('Location: '.$this->System->Link('/download/'));
    35       if($this->System->PathItems[0] == 'banners.php') Header('Location: '.$this->System->Link('/referrer/'));
    36       if($this->System->PathItems[0] == 'download.php') Header('Location: '.$this->System->Link('/download/'));
    37       if($this->System->PathItems[0] == 'serverlist.php') Header('Location: '.$this->System->Link('/server/'));
     34        if($this->System->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));
     35      if($this->System->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));
     36      if($this->System->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));
     37      if($this->System->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));
     38      if($this->System->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));
     39      if($this->System->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registrace.php'));
     40      if($this->System->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));
     41      if($this->System->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));
     42      if($this->System->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));
     43      if($this->System->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));
     44      if($this->System->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));
    3845      if(count($this->System->PathItems) > 1)
    3946      {
    4047        if(($this->System->PathItems[0] == 'team') and ($this->System->PathItems[1] == 'userlist.php'))
    41           Header('Location: '.$this->System->Link('/userlist.php'));
     48          $Output = $this->Redirect($this->System->Link('/userlist.php'));
    4249        if(($this->System->PathItems[0] == 'dictionary') and ($this->System->PathItems[1] == 'user.php'))
    43           Header('Location: '.$this->System->Link('/user.php'));
     50          $Output = $this->Redirect($this->System->Link('/user.php'));
    4451        if(($this->System->PathItems[0] == 'forum') and ($this->System->PathItems[1] == 'index.php'))
    45           Header('Location: '.$this->System->Link('/forum/'));
     52          $Output = $this->Redirect($this->System->Link('/forum/'));
    4653        if(($this->System->PathItems[0] == 'phpbb3') and ($this->System->PathItems[1] == 'index.php'))
    47           Header('Location: '.$this->System->Link('/forum/'));
     54          $Output = $this->Redirect($this->System->Link('/forum/'));
    4855        if(($this->System->PathItems[0] == 'phpBB3') and ($this->System->PathItems[1] == 'index.php'))
    49           Header('Location: '.$this->System->Link('/forum/'));
     56          $Output = $this->Redirect($this->System->Link('/forum/'));
    5057      }
    5158    }
    52     return('<h3 align="center">Požadovaná stránka byla přesunuta do nového umístění.</h3>');
     59    return($Output);
    5360  }
    5461}
Note: See TracChangeset for help on using the changeset viewer.