我是这个重定向的新手,我想知道它是如何工作的?我有一些名为 index.php 的文件,我想将它放在站点中的任何目录中
index.php
<?php
if(empty($dir)){
include('includes/home.php');
}
if($dir=='profile'){
include('includes/profile.php');
}
elseif($dir=='settings'){
include('includes/settings.php');
}
else{
include('includes/404.php');
}
?>
网址是:
test 1. www.example.com/ - will view the include home.
test 2. www.example.com/settings - will view the include settings.
test 3. www.example.com/errorsample - will view the include 404 page.
如何.htaccess
使用该代码制作和 index.php 或任何想法它的工作原理和示例代码。