-
Apache redirect for wildcard domains
We recently had to redirect a wildcard domain to another wildcard domain using Apache redirects. It is assumed you have already enabled mod_rewrite, if not make sure you enable that apache module before you try adding this rule.
RewriteEngine On RewriteRule ^([A-Za-z0-9-]+)\.domain1\.com?$ https://%1.domain2.com$1
Now there are certainly other versions of this rule (add below), but this did the trick for us.
Leave a reply