Reputation: 73
I want to redirect all sub domains of my webserver sites that start with mail to a https://anotherSub.domain.com
How can i do it?
Put this at the top of the yours default apache config file
RewriteEngine on
RewriteCond %{HTTP_HOST} ^SUBDOMAIN.*
RewriteRule ^(.*) YOUR LINK (ex. http://www.google.it)
Upvotes: 1
Views: 991
Reputation: 3435
This code matches any subdomain that starts with mail
on domain.com
and rewrites it to a https://anothersub.domain.com
.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mail(.*?).domain.com [NC]
RewriteRule ^(.*)$ https://anothersub.domain.com/$1 [L, 301]
Upvotes: 1