How can Modrewrite be used to avoid an endless loop in PHP redirection?

Modrewrite can be used to avoid an endless loop in PHP redirection by adding a condition that checks if the request has already been rewritten before redirecting. This can be achieved by checking if the requested URL matches the rewritten URL pattern before performing the redirection.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/redirected-page.php
RewriteRule ^original-page.php$ /redirected-page.php [L]