Hi @Bartosz Wesołowski ,
As far as I know, we can't implement this in web.config. We can just define a key-value in <appSettings> and then use the value in xxx.cs file. But we can not define a variable somewhere and use the variable in rewrite rule in web.config.
For this requirement, I think you can just edit the rule of your web.config. Or if you do not want to modify the web.config, you can also do it in "global.asax".
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.