Forum Discussion
numen_235631
Nimbostratus
Nov 24, 2015remapping issue
Hi, I need some help with irule (or any other solution that will help) I have to make my URLs shorter so I’m doing below remapping `Code`
when HTTP_REQUEST {
HTTP::uri [string map -nocase {"...
VernonWells
Employee
Nov 24, 2015The
string map substitutes every instance of / for /xxxxx. Thus, if the path-uri were /, it would change the path-uri to /xxxxx. If the path-uri were /foo/bar, it would change the path-uri to /xxxxxfoo/xxxxxbar. I believe what you are attempting to do is insert a path element at the start of any submitted path-uri, so that:
- if the user-agent requests http://link.domain.com/, the server sees /xxxxx/ as the request path-uri;
- if the user-agent requests http://link.domain.com/foo/bar, the server sees /xxxxx/foo/bar as the request path-uri;
- if the user-agent requests http://link.domain.com/images/logo.png, the server sees /xxxxx/images/logo.png as the request path-uri.
Is that correct? If so, then you should be able to simply do this:
when HTTP_REQUEST {
HTTP::uri "/xxxxx[HTTP::uri]"
}
If you are using BIG-IP 11.4 or higher, you could also use a Local Traffic Policy:
ltm policy expand-path {
controls { forwarding }
requires { http }
rules {
rule01 {
actions {
0 {
http-uri
replace
path /xxxxx[HTTP::uri]
}
}
ordinal 2
}
}
strategy first-match
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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