What role does mod_rewrite play in altering URLs in PHP?
Mod_rewrite is a module in Apache that allows for URL rewriting. In PHP, mod_rewrite can be used to alter URLs by rewriting them to a different format. This can be useful for creating cleaner, more user-friendly URLs or for redirecting URLs to different pages on a website.
RewriteEngine On
RewriteRule ^old-url$ new-url [L]