Forum Discussion
Andrew_Abplanal
Nimbostratus
Feb 28, 2007strip port information from URL on courtesy redirect
I have found that some versions of IIS add the server’s port information the URL on a courtesy redirect.
Currently I am stripping the port information using this iRule…..
i...
hoolio
Cirrostratus
Feb 28, 2007The only way I can think of handling this is to use a regular expression. I'm not sure whether it's better to use the regex or list out all possible values for the port.
If you wanted to list out all of the ports you could use a datagroup for simplified management.
Else, here's an example using regsub.
TCL man page for regsub: Click here
when HTTP_RESPONSE {
set location [HTTP::header value Location]
check to see if the Location header is set
if { not ($location == "") {
look to see if there is a string that contains a ":" followed by any number of digits followed by a forward slash
if so, replace that string with a forward slash
regsub {:\d+/} $location "/" newLocation
replace the existing Location header with the new value
HTTP::header replace Location $location
}
}Aaron
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