您的htaccess与安全性无关。我建议你使用开关的情况下是这样的:
$site = "home";
switch(strtolower($_SERVER['REQUEST_URI'])){
case "about":
$site = "about";
break;
case "contact":
$site = "contact";
break;
}
include "{$site}.php";
也许这样的:
$site = "home";
$page = strtolower($_SERVER['REQUEST_URI']);
switch($page){
case "about":
case "contact":
$site = $page;
break;
}
include "{$site}.php";
或者无需作出什么是当前的代码,你已经通过允许访问的网页
$path = "pages/";
$page = trim(strtolower($_SERVER['REQUEST_URI']),"/");
$slashPos = strpos($page, "/");
if($slashPos!==false){
$page = substr($page, 0, $slashPos);
}
$page = preg_replace("/[^a-z0-9-]/", "", $page);
if(file_exists("{$path}{$page}.php")){
include "{$path}{$page}.php";
}else{
//include "{$path}home.php";
}
名单执行此任务? – SaidbakR