Forum Discussion
Multiple domain redirects to subdomain
I have multiple domains on a single VIP using host headers. I would like an irule to redirect sitea.com to , siteb.com to and so on.
I think it can be done in a data group and iRule, but when I tested the following it didn't work.
Data Group List MULTI-SITE-IRULE sitea.com:= siteb.com:= sitec.com:= sited.com:= sitee.com:=
irule when HTTP_REQUEST { if {[set redir_host [class match -value -- [string tolower [HTTP::host]] equals MULTI-SITE-IRULE]] ne "" }{ HTTP::redirect $redir_host }
What am I doing wrong?
- moonkrj_373027
Nimbostratus
Have you tried to tie all that together with a Virtual Server? Seems to me that there's a solution on Ron Williams' website. And there's a thread on Stackoverflow https://stackoverflow.com/questions/17365397/redirect-multiple-domains-to-one-domain-with-or-without-www-before do my homework. You can use
for the domain with leading www.RewriteCond %{HTTP_HOST} ^/?(?:www\.)?domain1.com
- kolom
Altostratus
Hi rwagner1, You can use the below iRule.
when HTTP_REQUEST { if { !([HTTP::host] starts_with "www") } { HTTP::redirect "https://www.[HTTP::host]" } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com