$router = $_SERVER['REQUEST_URI']; // echo"
";
// print_r($_SERVER);
if($router){
$router = $_SERVER['REQUEST_URI'];
$router = str_replace('/blogs','',$router);
// str_contains($router , '?page=') ||
if($router == '' || $router == '/index.php' || strpos( $router, '?page=' ) !== false )
{
include 'home.php';
}
elseif($router == '/details/' || preg_match("/details\/[a-z]/i",$router)){
$array = explode("/", $router);
if(isset($array[2])){
include 'details.php';
}
else{
include '404.php';
}
}
elseif($router == '/about' || $router == '/about.php'){
include 'about.php';
}
elseif($router == '/contact' || $router == '/contact.php'){
include 'contact.php';
}
else {
include '404.php';
}
}
?>