Forum Discussion
Brian_Kenworthy
Nimbostratus
Feb 10, 2011HTTP>HTTPS Redirect to different domain
Hi all, this should be pretty simple....hopefully.
I have a simple HTTP>HTTPS redirect in place for a domain --> HTTP::redirect "https://[HTTP::host][HTTP::uri]"
We have several su...
yihwen_100254
Nimbostratus
Jul 30, 2012Posted By Joe on 02/10/2011 01:44 PM
if you always know that you want to move domainA.com to domainB.com, you could do something more generic like this
when HTTP_REQUEST {
if { [HTTP::host] ends_with "domainA.com" } {
HTTP::redirect "https://[getfield [HTTP::host] "." 1].domainB.com[HTTP::uri]"
}
}That would redirect all requests to XXX.domainA.com to XXX.domainB.com retaining the URIs.
Of course, if you have more domains to match on, then the class lookup will likely be a better solution.
-Joe
Hi Joe
Your suggestion looks good. Does your iRule works the same if we are redirecting from .com to say .com.sg?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
