How can the RewriteRule be modified to change the file extension from .htm to .php in the given example?

To change the file extension from .htm to .php using RewriteRule, we need to modify the regular expression pattern to match .htm files and then redirect them to the corresponding .php file. This can be achieved by using the following RewriteRule in the .htaccess file: ```apache RewriteEngine On RewriteRule ^(.+)\.htm$ $1.php [L] ``` This rule captures any request ending with .htm and redirects it to the same filename with the .php extension.