I want to redirect all pages under a certain directory to a single file, like so:
With the straightforward
RedirectMatch 301 ^/dir/ http://example.com/dir/new
I get a redirect loop, since /dir/new redirects to itself. I replaced it with a regular expression
RedirectMatch 301 ^/dir/($|[^n]|n$|n[^e]|ne$|ne[^w]|new.) http://example.com/dir/new
which matches all URLs except the desired one. This works, but it's obviously the 'wrong' way to do it. What's a better way?