Forum Discussion
pbelamge_70866
May 20, 2011Nimbostratus
URL Re-Writing help needed
Hello All,
I am new to iRule and would like to know how can I solve my below mentioned problem
I have f5 switch and want this switch to filter incoming http requests based on domain / path and etc. After filtering this, it should send ONLY the path of the uri to the pool. Not absolute url
For. e.g.
If incoming request is "http://test.domain.com/path/object.html?args=value", then f5 switch should send the uri to the pool as "/path/object.html?args=value"
Thanks,
pbelamge
- Michael_YatesNimbostratusYou cannot just send the URI. That would be out of context on an HTTP Request.
- hooleylistCirrostratusIs the client sending an absolute URL in the URI and the web app can't handle this? If so, do you want to remove the protocol and host from the URI? If that's the case, you should be able to use something like this:
when HTTP_REQUEST { Check for an absolute URI if {not ([HTTP::uri] starts_with "/")}{ if {[scan $abs_uri {%[^/]//%[^/]%s} proto host uri] == 3}{ Log and set the URI to a local URI log local0. "\$proto: $proto, \$host: $host, \$uri: $uri" HTTP::uri $uri } } }
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