-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
27 lines (23 loc) · 693 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
$routes = [
"" => "views/home.php",
"/" => "views/home.php",
"/buy" => "views/buy.php",
"/home" => "views/home.php",
"/hire" => "views/hire.php",
"/index" => "views/home.php",
"/login" => "views/login.php",
"/about" => "views/about.php",
"/search" => "views/search.php",
"/index.php" => "views/home.php",
"/contact" => "views/contact.php",
"/logout" => "php/config/logout.php"
];
$request_url = $_SERVER["REQUEST_URI"];
$request_url = strtok($request_url, "?");
$request_url = rtrim($request_url, "/");
if (array_key_exists($request_url, $routes)) {
include_once $routes[$request_url];
} else {
include_once "views/404.php";
}