Is this for a single link or an entire website? If it’s the latter, you probably need some kind of wildcard setup, but it should be possible to do this in cPanel without having to get your hands dirty with code.
Thanks, just found out I don’t think it can be done at HT level, the server guy did it at some other level, no idea which, but it works so it’s all good.