Specific URL Rewriting with parameters in wordpress

Based on the info in the comments, here’s my preliminary answer, hopefully helping to debug the issue rather than a fix as I can’t see enough info for that — not the OP’s fault, rewrite debugging is just a pain.

The rewrite rule is obviously passing something to WP but WP isn’t happy with it.

What I’d do is add some debugging code to your theme’s 404.php that can show you the URL called and also the URL that WP is failing to parse. That at least will let you see whether your rewrite rule is doing what you expect.

Two other points though:

1 – If you don’t move your own htaccess code outside WP’s BEGIN and END then your changes will be overwritten if ever your site performs a hard save of its rewrites.

2 – It might be seen as better practice to code rewrite rules for your old URL structure within WP as a plugin instead of rewriting in htaccess.