The solution I use is to create a Static / CGI / PHP application (which I call redirects) and put the .htaccess file in its root. I specify all the domains and subdomains that need to be redirected to this application, and then I fill out the .htaccess file with all the necessary redirection directives for my server, for example:
RewriteEngine on RewriteCond %{HTTP_HOST} www.example.com RewriteRule ^(.*) http://example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} www.example1.com RewriteRule ^(.*) http://example1.com/$1 [R=301,L]
It works well, and since it is instantaneous, it is easy to debug.
tttallis
source share