I've quit trying to find a pair of pattern->substitution to regex-redirect missing files to the folder they are in, because all of them end up in an infinite loop, so now I'm adding my rewrite rules as a whole, hooking them to mod_rewrite_rules, so I can add a rewriteCond above each.
The problem is that the files redirected get a trailing forward slash added, like
/_here/findme.swf/
If I put my rules AFTER wordpress they won't work.
If I remove wordpres redirects, they work fine, but I need my WP rewrites for SEO!
Here's the code I'm using.
function find_findme_anywhere( $rules ) {
return "/n#Finds findme.swf
RewriteEngine On
RewriteBase /
Options +FollowSymlinks
RewriteCond %{REQUEST_URI} !_here/
RewriteRule ^.*findme.swf$ /_here/findme.app/Contents/Resources/findme.swf [R=301,L]" . $rules;
}
add_filter('mod_rewrite_rules', 'find_findme_anywhere');