Forum Discussion
kiamars_51328
Nimbostratus
May 18, 2009How can I get rid of the port on redirects.
Hi, I can redirect to new port, but how can i elemenated the port, I don't want to see the port that I am redirecting.
thx for your time.
hoolio
Cirrostratus
May 18, 2009Hi,
Here is a Codeshare example which shows how to remove the port from the Location header value in 30x redirects:
http://devcentral.f5.com/wiki/default.aspx/iRules/RewriteHTTPRedirectPort.html
when HTTP_RESPONSE {
Check if server response is a redirect
if { [HTTP::header is_redirect]} {
Log original and updated values
log local0. "Original Location header value: [HTTP::header value Location],\
updated: [string map ":[TCP::remote_port]/ /" [HTTP::header value Location]]"
Do the update
HTTP::header replace Location [string map ":[TCP::remote_port]/ /" [HTTP::header value 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