나는이 리다이렉션에 대해 새로운 것이므로 어떻게 작동하는지 알고 싶다. 나는의 index.php라는 일부 파일이 있고 난PHP .htacces 및 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');
}
?>
URL이 사이트에 어떤 디렉토리를 hadlle 할 :
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 또는 어떤 생각이 어떻게 작동하고 그것의 샘플 코드.
왜 작동하지 않습니까? .htacces # 1 워드 RewriteRule의 온 한다 RewriteEngine (^. *) $ /index.php?x=$1 [L] # END의 워드 의 index.php를 BEGIN
–Wordpress에는 이러한 유형의 탐색을위한 자체 '.htaccess' 파일이 있습니다. 내 규칙을 무시하는 다른 규칙이있을 것입니다. – Starx