I have several Redirect directives in my Ubuntu /etc/apache2/sites-available file:
Redirect 301 /rss.xml http://example.com/feed/index.xml Redirect 301 /atom.xml http://example.com/feed/atom/index.xml Redirect 301 /feed/ http://example.com/feed/index.xml Redirect 301 /feed http://example.com/feed/index.xml
They all work correctly, so far as I can tell.
However, when I visit http://example.com/feed/index.xml with web-sniffer.net, it returns a 301 pointing at http://example.com/feed/index.xmlindex.xml, which then gets redirected to http://example.com/feed/index.xmlindex.xmlindex.xml, and so forth.
It seems that one of the patterns is matching when I don't expect it to. If I omit the last two redirects, the looping is stopped, but then I'm not redirecting /feed and /feed/ when I should.
Any ideas of how make this work correctly?
(I think the problem is related to this question: http://serverfault.com/questions/155028/infinite-redirect-loop)