Advertisement
vanchelo

Router

Dec 1st, 2012
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. if ($modx->event->name == 'OnPageNotFound') {
  3.  
  4. if ($modx->getOption('friendly_urls')) {
  5.     if (!function_exists('cleanArray')) {
  6.         function cleanArray($array) {
  7.             $Result = array();
  8.             foreach ($array as $key => $value) {
  9.                 if ($value != '')
  10.                     $Result[] = $value;
  11.             }
  12.             return $Result;
  13.         }
  14.     }
  15.     $url = cleanArray(explode('/',$_SERVER['REQUEST_URI']));
  16.    
  17.     if ($url[count($url)-1] == 'compare') {
  18.         $modx->sendForward(118);
  19.     }
  20. }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement