How would you go about cleaning up a huge list of rewrites that accumulated over many years? The idea is to get rid of all the overridden and unused redirect statements while preserving everything that works.
I am thinking of enabling RewriteLog and setting RewriteLogLevel to 3 or 4 for a day or so, then parsing through the log and identifying "dead" rewrites, commenting them out, then checking the logs for fresh 404s.
Have you had to do a mod_rewrite cleanup like that and/or do you have any other ideas?
The difficulty in this task is multifold; if they're not commented then you have to reverse engineer them into some common English and get other people to help answer "does anyone know why this is here?" type of issues. Some of these rewrites may also be linked to from outside (think a blog or forum post somewhere) that people still use -- I have one link that's on a forum from years ago that people still find with Google and use to get to the content, so I can't really get rid of it.
Your best solution is to do some log monitoring/parsing (I like AWstats) over a period of time and see what requests are actually coming in the front door, this will at least give you an idea of what you can't touch. Them you just have to go over what's left, hopefully pulling in other people who've been around the company for a long time to help.
You could in theory simply mine your access log to see what URLs people are requesting, rather than enabling RewriteLog (which may have a performance impact). If you wanted to get fancy, you could replace your static RewriteRules with a programmatic RewriteMap and then maintain actual statistics on how often the rewrites are used.