$url = get_current_url();//"about.ttl"; if(isset($_GET['url'])){ $url = $_GET['url']; }else{ $indexless = str_replace("index.php", "", $url); header("Location: $indexless?url=$indexless"); } function get_current_url() { $protocol = 'http'; if ($_SERVER['SERVER_PORT'] == 443 || (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on')) { $protocol .= 's'; $protocol_port = $_SERVER['SERVER_PORT']; } else { $protocol_port = 80; } $host = $_SERVER['HTTP_HOST']; $port = $_SERVER['SERVER_PORT']; $request = $_SERVER['PHP_SELF']; $query = substr($_SERVER['argv'][0], strpos($_SERVER['argv'][0], ';') + 1); $toret = $protocol . '://' . $host . ($port == $protocol_port ? '' : ':' . $port) . $request . (empty($query) ? '' : '?' . $query); return $toret; } ?>