htaccess redirectmatch regular expression to avoid infinite loop
<p>I have a malformed link somewhere which sends people to my sitemap but to a URL like </p>

<pre><code>www.example.com/sitemap.php'"abc def 
</code></pre>

<p>etc. This then presents them with broken links.</p>

<p>While I hunt down the bad link, I wrote a 301 like this to make all traffic to the page be 301ed and cleaned up:</p>

<pre><code>RedirectMatch 301 ^sitemap.php(.*) http://www.example.com/sitemap.php
</code></pre>

<p>But this gives me a "too many 301s" errors because site.com/sitemap.php matches the expression and it gets looped. Is there a regular expression that I can use instead of (.*) that will not match if there is nothing there at all (ie if the URL just ends with ".php"? </p>