require_once('../includes/functions.php'); require_once('../includes/db_connect.php'); $redirect = 'Location: ' . ROOT_PATH . TEMPLATE_SD; $var_array = explode("/",$_GET['url']); $cat = str_replace("_", " ", $var_array[1]); if (!empty($var_array[2])){ $page=$var_array[2]; } if ($cat == '3 column') $cat = '3 columns'; if ($cat == '2 column') $cat = '2 columns'; if ($cat == 'web2.0') $cat = 'web 2.0'; if (!empty($cat)) { if (db_query('select id from template_cat where name="' . $cat . '"')){ $redirect = $redirect . $cat = str_replace(" ", "-",$cat) . '/' . $page; } else { not_found(); } } elseif (count($var_array) > 1) { not_found(); } Header( "HTTP/1.1 301 Moved Permanently" ); Header( $redirect ); ?>