How can the RewriteCond directive be used in conjunction with mod_rewrite to prevent rewriting requests for existing files?

The RewriteCond directive in mod_rewrite can be used to prevent rewriting requests for existing files by checking if the requested file actually exists on the server before applying any rewrite rules. This can help avoid unnecessary rewriting for existing resources like images, CSS files, or scripts. ```apache RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php [L] ``` In this example, the RewriteCond %{REQUEST_FILENAME} !-f condition checks if the requested file does not exist (-f) before applying the rewrite rule. The second condition %{REQUEST_FILENAME} !-d checks if the requested file is not a directory (-d). If both conditions are met, the RewriteRule will be applied.