Forum Discussion
agidwani_102403
Nimbostratus
Feb 21, 2008Need help
hello,
I need to accomplish the following
rewrite the uri https://aa.mycompany.com/compA/blah.acmx (can have companyA, Company123, CompanyABC etc)
rewrite the uri to htt...
Phil_Rudich_735
Nimbostratus
Aug 15, 2008This is what one of our internal programmers came up with. However, it doesn't work 100% of the time.
when HTTP_REQUEST {
set header [HTTP::host]
set splitVals [split $header "."]
set urlPartCount [llength $splitVals]
if {$urlPartCount eq 4} {
set firstPart [string tolower [lindex $splitVals 0]]
switch $firstPart {
"hrp"
{
set splitVals [lreplace $splitVals 0 0]
lset splitVals 0 [lindex $splitVals 0]hrp
}
"www"
{
set splitVals [lreplace $splitVals 0 0]
}
}
set returnVal [join $splitVals "."]
HTTP::redirect "https://$returnVal"
}
}
Any ideas???
Thanks!
Phil
Recent Discussions
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
