What are the potential drawbacks of trying to maintain a website with only one URL in PHP?

One potential drawback of trying to maintain a website with only one URL in PHP is that it can make the codebase less modular and harder to maintain in the long run. To solve this issue, you can implement a routing system that maps different URLs to different PHP files or functions based on the requested route.

<?php

// Define a routing system to handle different URLs
$requestedUrl = $_SERVER['REQUEST_URI'];

switch ($requestedUrl) {
    case '/':
        include 'home.php';
        break;
    case '/about':
        include 'about.php';
        break;
    case '/contact':
        include 'contact.php';
        break;
    default:
        include '404.php';
        break;
}