Forum Discussion
Andrea_Arquint
Nimbostratus
Apr 15, 2010string substitution
Hi
I want to create an iRule which does the following:
when HTTP_REQUEST {
set host_orig [string tolower [HTTP::host]]
if { $host_orig contains ".gtm"} {
remove the string ".gtm" and return the modified "host" without the string ".gtm" in it
}
}
If I would request "www.gtm.mydom.com" then I will be redirected to www.mydom.com dynamically.
Even for example for:
test.gtm.mydom.com
www.gtm.otherdom.net
www.gtm.nextdom.org
asf
Why do I need this?
We use GTM's and our DNS provider does delegating everything "gtm.mydom.com" to both of our GTM's. So that's why "http://gtm.mydom.com can be resolved what we don't want.
Thanx for any help
:-)
- hoolio
Cirrostratus
How about this to send a permanent redirect to the requested host with the .gtm removed?when HTTP_REQUEST { if {[string tolower [HTTP::host]] contains ".gtm."}{ HTTP::respond 301 Location "[string map {gtm. ""} [HTTP::host]]" } }
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