How can the use of routing in PHP websites enhance search engine optimization and user readability?

Using routing in PHP websites can enhance search engine optimization by creating clean and user-friendly URLs that are easier for search engines to crawl and index. This can improve the overall visibility of the website in search engine results. Additionally, routing can also enhance user readability by making URLs more descriptive and easier to understand for visitors.

<?php
// Enable routing in PHP
$uri = $_SERVER['REQUEST_URI'];

if ($uri === '/about') {
    include 'about.php';
} elseif ($uri === '/contact') {
    include 'contact.php';
} else {
    include '404.php';
}
?>