I have a file foo.bar.1 on my server and when I try to access it from a browser (firefox) I get a popup that says "You have chosen to open foo.bar.1 which is a: 1 file ... What should Firefox do with this file...". If I create a symlink to it, foo.dat, I can access it just fine; the contents display in the browser as I expect.
My problem is that I don't want to create symlinks for all these files, I want to use a mod_rewrite rule, like
RewriteRule ^([^/]+)\.dat$ $1.bar.1
But that doesn't act like the symlink. It gives the same popup (though, strangely, it now says "You have chosen to open foo.dat which is a: DAT file ...".
How can I do the rewrite rule such that the browser is tricked into treating it like a normal .dat file, as is accomplished by the symlink?