RewriteRule ^(/.*\.db\.xml)$ /cgi-bin/DBXMLViewer.cgi?xmlFileName=$1 [R,NE,L]
I'm using an apache config file with the directive above which instructs the server to open any *.db.xml file with the DBXMLViewer.cgi program. I only want this done when the file is accessed with a left click which is what happens now, so that works properly.

The problem is if I right click to save link as to save the actual db.xml file, the file I'm prompted to save is DBXMLViewer.cgi and not the db.xml file. How can I change this so that the db.xml file can be downloaded with save link as while preserving opening the file with DBXMLViewer.cgi on left clicks?

Thanks for any help!