A RewriteRule loops when the target of the rule matches the initial rewrite pattern. For example, if you were to rewrite all URLs starting with "foo" to "foo.php", then "foo.php" would also get rewritten to "foo.php", and so on, forever.
For example, consider the following rule:
A simple redirect. The resulting URL matches the RewriteRule (because it starts with /example and redirects. And again. And again. You get the idea.
This is solved by prefacing your RewriteRule with a RewriteCond to catch that condition, thus:
That says the same thing as the previous recipe, except that it also says to only run the rule if the incoming request doesn't look like example.html. Problem solved. No more looping.
There is also a method involving regular expressions using a common method called "negative lookahead":