I wrote a bash script to automate the Apache (mod_rewrite) URL redirection. It supports 3 types of redirection:
The script can be downloaded from here
Note: I tested the script in my local, so the script spoof the domain to local in the hosts file. Remove that part if the fqdn can be resolved.