Forum Discussion
Jeff_Tuthill_10
Nimbostratus
Nov 25, 2008URL Change
I have an open source application, similar to Sharepoint, that build URL's on the fly. I have an SSL cert on the F5 to make it https://, but the server is clear, http://. For some reason, one of the links the application builds inserts the http:// URL inside the https:// URL. Here is an example:
I want this:
http://mysite.com/some/dir
I get this
http://mysite.comhttp//mysite.com/some/dir
Is there a way to strip out a string within a URL?
Would I need a redirect rule that that sends to the correct host, while preserving the original URI? What would this look like?
Thanks
Jeff
- hoolio
Cirrostratus
Hi Jeff,when HTTP_RESPONSE { Check if response is a redirect if {[HTTP::is_redirect]}{ Replace http//mysite.com with nothing if it's present in the Location header value HTTP::header replace Location [string map {http//mysite.com ""} [HTTP::header value Location]] } }
when HTTP_RESPONSE { Check if response is a redirect if {[HTTP::is_redirect]}{ Replace http//mysite.com with nothing if it's present in the Location header value HTTP::header replace Location [string map [list http//mysite.com ""] [HTTP::header value Location]] } Check if response content type is text if {[HTTP::header value "Content-Type"] starts_with "text"}{ Set the stream expression STREAM::expression "@http//mysite.com@@" Enable the stream filter STREAM::enable } else { Response wasn't text, so disable the stream filter STREAM::disable } }
- Jeff_Tuthill_10
Nimbostratus
Thanks for the reply... - Jeff_Tuthill_10
Nimbostratus
Thanks for the reply... - hoolio
Cirrostratus
Hi Jeff,when HTTP_REQUEST { Check if URI starts with //mysite.com if {[HTTP::path] starts_with "//mysite.com" Replace //mysite.com with / in the path HTTP::path [string map {//mysite.com /} [HTTP::path]] } }
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