What are some alternative solutions to mod_rewrite for URL rewriting in PHP?

One alternative solution to mod_rewrite for URL rewriting in PHP is to use the built-in $_SERVER['REQUEST_URI'] variable to parse and handle URLs. This variable contains the URI of the current request, which can be manipulated to achieve URL rewriting functionality.

$request_uri = $_SERVER['REQUEST_URI'];

// Perform URL rewriting logic here
// For example, you can use a switch statement to handle different URL patterns
switch ($request_uri) {
    case '/about':
        include 'about.php';
        break;
    case '/contact':
        include 'contact.php';
        break;
    default:
        include '404.php';
}