What role does mod_rewrite play in converting dynamic PHP pages to static HTML pages?

Mod_rewrite plays a crucial role in converting dynamic PHP pages to static HTML pages by allowing for the rewriting of URLs in a server-side manner. This means that requests for dynamic PHP pages can be intercepted and redirected to their corresponding static HTML counterparts. By using mod_rewrite rules in the .htaccess file, dynamic URLs can be rewritten to appear as static HTML pages to both users and search engines, improving site performance and SEO.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ $1.php [L]