Redirect if address has a value

hello everyone, I have a problem to resolve.
I have a dynamic page showing data, ​​based on the query passed by the URL.
The address of that page is something like:
www.mysite.com?f=AS0001
In the DB there’s a record with wrong value (SA1111), that momentarily I cannot change:
So I would like that only for this case:
www.mysite.com?f=SA1111
the page makes a forced redirect to:
www.mysite.com?f=AS1111
How can I do that?
Thanks!!!

You can use htaccess/web.config to do the redirect on the server.

Seems working with this Custom query:

SELECT *  
FROM  MYTABLE WHERE codazienda = case when ( :P1 /* {{$_GET.f}} */ ) ='SA1111' then 'AS1111' else :P1 /* {{$_GET.f}} */  end AND attivo = 1