Forum Discussion
Brett_10648
Nimbostratus
Oct 31, 2012Apache proxy rewrite to F5
Hi,
I'm tring to convert the following Apache Rewrite rule to an F5 iRul but am having no luck. I think I am am on the right track but would be grateful for any assistance.
This is the apache rule:
RewriteRule ^(.*)/lmykproxy/(.*) http://subdomain.domain.com/$2 [P,L]
This is the iRule I have so far..
when HTTP_REQUEST {
if {[HTTP::uri] contains "lmykproxy"} {
log "Requested URL is [HTTP::host][HTTP::uri]"
set newuri [findstr [HTTP::uri] /lmykproxy/ 11]
HTTP::uri "$newuri"
HTTP::header replace "Host" "subdomain.domain.com"
log "New URL is [HTTP::host][HTTP::uri]"
}
}
Thanks in advance.
1 Reply
- What_Lies_Bene1
Cirrostratus
Unfortunately I don't understand the original rewrite rule but I hope this will help;when HTTP_REQUEST { if { [HTTP::uri] contains "lmykproxy" } { log local0. "Requested URL is [HTTP::host][HTTP::uri]" Added local0. above set newuri [findstr [HTTP::uri] /lmykproxy 10] Modified above so the URI contains a starting "/" HTTP::uri $newuri HTTP::header replace "Host" "subdomain.domain.com" I'm not sure you need "" around the domain name??? log local0. "New URL is [HTTP::host][HTTP::uri]" Added local0. above } }
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