I recently migrated from Trac (at http://recurser.com/trac/ ) to Redmine (at http://recurser.com/code/ ), and wanted the Trac links to redirect to the right place if possible. The nginx rules that follow achieve most of that. As always, there are a few catches:
I’m not sure how well the wiki re-writing works, as i don’t really use the wiki much for personal stuff. Trac & Redmine might use a different format for naming pages. There’s only a few wiki pages that get any traffic, so i redirected them explicitly.
Redmine doesn’t seem to support repositories with an underscore (‘_’) in the name - i had to rename my repositories to use hyphens instead, & then add specific rewrite rules for those repositories.
I haven’t had time to figure out how to rewrite comparisons of selected revisions yet (eg. if we’re now at revision 500, look at diffs for revision 200 vs revision 300).
It should handle most simple cases though.