[PHP] 纯文本查看 复制代码
<?php
//用处很简单,就是在当前网址是xxx.com/index.php时,自动跳到xxx.com/上,这样网址看起来就美观的多
class index{
public static function jump(){
$http_type = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
if (strpos($_SERVER['REQUEST_URI'],'index.php')){header('Location: '.$http_type.$_SERVER['HTTP_HOST'].str_replace('index.php', "", $_SERVER['REQUEST_URI']));}
}
}
index::jump();
?>