I'm trying to rewrite a web address to remove a directory, if it exists. In other words, if someone navigates to www.domain.com/a/bad/b/c/page.pdf, the RewriteRule should remove /bad/ and send them to www.domain.com/a/b/c/page.pdf.
The /bad/ directory will always be in the 2nd position in the URL, as in the example. The paths will always be to PDFs, if that makes a difference.
I've tried things, but no luck. I feel like this should be fairly simple. Any suggestions?
OK, after more digging I found my answer: