Greetings to all I have my URL http://localhost/?page= and when I have that I just want http://localhost/ Because it's loading the same home page for that URL but I don't want to show this "/?page=" in URL. How can I do that? Because I'm trying to create some MVC in my PHP folder structure
public function __invoke(){
$page = (isset($_GET['page']) && !empty($_GET['page'])) ? $_GET['page'] : "home";
switch ($page) {
case "home":
$title = "Home of APP";
require __DIR__."/../views/includes/main-header.php";
require __DIR__."/../views/home.php";
require __DIR__."/../views/includes/main-footer.php";
break;
case "insertCategories":
$this->category_sub_category_questions->insertCategories("Sitewide Creative");
$this->category_sub_category_questions->insertCategories("Global Elements");
$this->category_sub_category_questions->insertCategories("Core Ecommerce Pages");
$this->category_sub_category_questions->insertCategories("Advanced Ecommerce Features");
$this->category_sub_category_questions->insertCategories("Brand Pages");
$this->category_sub_category_questions->insertCategories("Development Environment Setup");
$this->category_sub_category_questions->insertCategories("Launch and Post-launch");
$this->category_sub_category_questions->insertCategories("Measurement and Conversion Optimization");
$this->category_sub_category_questions->insertCategories("Consulting Services");
echo "Categories Inserted!";
break;
default:
require __DIR__."/../views/errors/404.php";
break;
}
}