通过htaccess将下载文件重定向到新的命名文件

Over time, filenames of our software have changed for various reasons, so an old download file pointed to by shareware sites no longer exists.

I want to redirect so that if somebody clicks a link to the old file they can download the new (different named) version.

So I tried adding a .htaccess file into public_html that contains the following (and nothing else):

Redirect 301 mydomain.com/oldinstaller.exe mydomain.com/newinstaller.exe

But that didnt work, I get 500 errors issued by the server. All files are in public_html and so is the .htaccess file. Any ideas what I am doing wrong?

UPDATE

I tried the following:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^oldinstaller.msi /newinstaller.exe [R=301,L]

and the browser is given this URL:

https://example.com/home/admin/web/example.com/public_html/newinstaller.exe

And if I try:

RewriteRule ^oldinstaller.msi$ example.com/newinstaller.exe [R=301,L]

I get:

https://example.com/example.com/newinstaller.exe

Try mod_rewrite redirecting using

RewriteRule ^oldinstaller.exe /newinstaller.exe [R=301,L]

or redirect by adding HTTP headers in your php page

This should make a trick:

Filename: .htaccess

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^oldinstaller.exe$ mydomain.com/newinstaller.exe [R=301,L]