Forum Discussion
Ian_Amos_37833
Nimbostratus
Aug 31, 2007URL rewrite..
Hello all,
here's what i'm trying to do:
There is a site with both internal and external URL's (INT dev.site.sub, EXT dev.site.net) where the external URL is fronted by an LTM.
Sections of this site (/rweb) are protected via Siteminder.
When you hit the internal URL dev.site.sub/rweb, Siteminder kicks in and presents dev.site.sub/siteminder.. and requests authentication - which all works perfectly, as everything is within our CN.
When you hit the external URL dev.site.net/rweb, Siteminder kicks in but still presents dev.site.sub/siteminder.. which is fine if you happen to be in the CN, but obviously not over the web.
What I would like to do is have the LTM rewrite the URL, such that when Siteminder presents dev.site.sub/siteminder, the iRule rewrites that to dev.site.net/siteminder etc..
I have read Kirk's ProxyPass iRule and given it a go, but still cannot get it to work (unfortunately I am not given any errors in the log).
I have working rules which rewrite the URL, but ideally only want this rule to rewrite everything behind /siteminder..
Can anyone suggest anything else to try?
- Kirk_Bauer_1018
Nimbostratus
ProxyPass as it is written today assumes the client will ask for a URL which we will then translate, not that a server will redirect to a name that needs to be translated (although that is something I may need to consider). Try this rule out: - Ian_Amos_37833
Nimbostratus
Hmmm.. thanks for this.when HTTP_RESPONSE { if { [HTTP::header exists "Location"] } { if { [HTTP::header starts_with "http://dev.site.sub/siteminder"] } { set remainder [substr [HTTP::header "Location"] 20] HTTP::header replace "Location" "http://dev.site.net/siteminder/$remainder" } } }
- Kirk_Bauer_1018
Nimbostratus
All I can find on that error is here: Posted By IanAmos on 08/31/2007 7:00 AM
when HTTP_RESPONSE { if { [HTTP::header exists "Location"] } { if { [HTTP::header starts_with "http://dev.site.sub/siteminder"] } { set remainder [substr [HTTP::header "Location"] 20] HTTP::header replace "Location" "http://dev.site.net/siteminder/$remainder" } } }
when HTTP_RESPONSE { if { [HTTP::header exists "Location"] } { 1: compare Location header with uri if { [HTTP::header "Location"] starts_with "http://dev.site.sub/siteminder" } { set remainder [substr [HTTP::header "Location"] 20] 2: removed "siteminder/" from replacement string HTTP::header replace "Location" "http://dev.site.net/$remainder" } } }
when HTTP_RESPONSE { if { [HTTP::header exists "Location"] } { if { [HTTP::header "Location"] starts_with "http://dev.site.sub/siteminder" } { HTTP::header replace "Location" "http://dev.site.net/[substr [HTTP::header "Location"] 20]" } } }
- Ian_Amos_37833
Nimbostratus
Posted By Joe on 08/31/2007 10:42 AM
when HTTP_RESPONSE { if { [HTTP::header exists "Location"] } { if { [HTTP::header "Location"] starts_with "http://dev.site.sub/siteminder" } { HTTP::header replace "Location" "http://dev.site.net/[substr [HTTP::header "Location"] 20]" } } }
7 http_process_state_prepend - Invalid action EV_EGRESS_DATA during ST_HTTP_PREPEND_HEADERS
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