Forum Discussion
Sams_88783
Nimbostratus
Dec 01, 2010Irule Help
We have a site hosted in our webspere server which requires a http redirect.so i have created a irule with
when HTTP_REQUEST {
HTTP::redirect "http://[HTTP::host][HTTP::uri]"
}
This left the WebSphere port in the redirect, how to remove the port ?
Please help with this.
Thanks
- hoolio
Cirrostratus
Hi Sams, - Sams_88783
Nimbostratus
Aaron correct me if i am worng so the irule will be as below correct ? my concern is to remove webspere port because code can add the WebSphere port at any time. - hoolio
Cirrostratus
If I understand your scenario correctly, that's close. You just need to strip out the port on requests:when HTTP_REQUEST { Remove the port from the host header if present and send a redirect to the same URI HTTP::redirect "http://[getfield [HTTP::host] : 1][HTTP::uri]" } when HTTP_RESPONSE { Check if response is a redirect baseed on status code if { [HTTP::header is_redirect]} { Update the location header by removing the pool member's port HTTP::header replace Location [string map ":[TCP::server_port]/ /" [HTTP::header value Location]] } }
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