Forum Discussion
AndyCooney_1337
Nimbostratus
May 22, 2011rewrite .com to .org for any domain
We host many of our sites as .org but still register the .com and .net domains. We'd like to have a single VIP that takes any "requested_domain.com" and rewrites it to "requested_domain.org". Currentl...
hoolio
Cirrostratus
May 22, 2011I think you could do this with string commands more efficiently:
when HTTP_REQUEST {
Check if host doesn't end with .org and has at least one alpha character
if { not ([string tolower [HTTP::host]] ends_with ".org") and [string match {[a-zA-Z]} [HTTP::host]] }{
Redirect to the same host with the last three characters removed and org added
HTTP::redirect "http://[string range [HTTP::host] 0 end-3]org[HTTP::uri]"
}
}
Aaron
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