How can mod_rewrite from Apache be used to make variables in the URL more user-friendly in PHP?

Mod_rewrite from Apache can be used to rewrite URLs in a more user-friendly format by creating clean and readable URLs that include variables. This can improve the user experience and make the URLs more SEO-friendly. By using mod_rewrite rules in the .htaccess file, you can transform URLs with variables into cleaner URLs that are easier for users to understand and remember. ```apache RewriteEngine On RewriteRule ^products/([0-9]+)/?$ product.php?id=$1 [NC,L] ``` In this example, the mod_rewrite rule rewrites a URL like "/products/123" to "/product.php?id=123", making the URL more user-friendly and easier to navigate.