Forum Discussion
veyond_113181
Mar 13, 2007Nimbostratus
redirect domain.com to https://www.domain.com
I am using a http redirect rule to redirect all http traffic to https. That works fine but the problem I am having is that the SSL cert is only for www.domain.com. The client is very picky and wants domain.com to work as well. So, I have created the following rule:
when HTTP_REQUEST {
if { [HTTP::host] equals "http://domain.com"}{
HTTP::redirect "https://www.domain.com[HTTP::uri]"
}
}
The problem is I am not sure where to put this. I have added it to the irules for www.domain.com but it doesnt work. When i try to create a new virtual server and point it to the same IP address I get:
01070333:3: Virtual Server domain.com illegally shares both address and vlan with Virtual Server www.domain.com.
What is the best way to take all domain.com traffic and forward it to www.domain.com?
Thanks,
Tate
- Trevor_Lee_9409NimbostratusThe way that I do it is the following:
- The value of HTTP::host does not include the protocol specifier. This should work for you.
when HTTP_REQUEST { if { [HTTP::host] eq "domain.com" } { HTTP::redirect "https://www.domain.com[HTTP::uri]" } }
- veyond_113181NimbostratusYes, I have both 80 and 443 set up. This seems to be working perfectly. Thank you for the help
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects