What potential pitfalls should be considered when using mod_rewrite for URL rewriting in PHP, especially on different server configurations like IIS?

One potential pitfall when using mod_rewrite for URL rewriting in PHP is that the server configuration may vary, especially when switching between Apache and IIS servers. To ensure compatibility across different server configurations, it's important to use server variables like $_SERVER['REQUEST_URI'] instead of hardcoded URLs in your rewrite rules. This allows your code to adapt to different server environments without breaking.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]