What are the potential pitfalls to avoid when using mod_rewrite in PHP?

One potential pitfall to avoid when using mod_rewrite in PHP is creating an infinite loop by incorrectly redirecting URLs. To prevent this, always include a condition to check if the requested URL matches the rewritten URL before applying the rewrite rule.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/rewritten-url$
RewriteRule ^original-url$ /rewritten-url [L]