How can mod_rewrite in Apache be utilized to create more user-friendly and SEO-friendly URLs in PHP?

One way to create more user-friendly and SEO-friendly URLs in PHP is by using mod_rewrite in Apache to rewrite URLs. This can be achieved by creating rules in the .htaccess file that map clean URLs to the actual PHP files or scripts. By doing this, you can improve the readability of your URLs and make them more search engine friendly. ```apache RewriteEngine On RewriteRule ^products/([0-9]+)/?$ products.php?id=$1 [NC,L] ``` In this example, the rule will rewrite a URL like "example.com/products/123" to "example.com/products.php?id=123". This way, users see a cleaner URL while the server still processes the request correctly.