Forum Discussion
Brantly_Perry_1
Nimbostratus
Nov 12, 2008Need HTTP Redirect assistance
Hey everyone. Need assistance figuring out the best way to accomplish a redirect.
http://host.com/uri
needs to redirect to
http://host.com/member?cid=uri ...
hoolio
Cirrostratus
Nov 13, 2008What are the symptoms of the problem you're seeing with the last rule? Which requests are not being rewritten correctly? What are they being rewritten to?
I think this might be what you're looking for:
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New request to : [HTTP::uri]"
switch [HTTP::path] {
"/" { HTTP::path "/member" }
"/bp" { HTTP::uri "/member?cid=[HTTP::uri]" }
"/eb-member-earAdmin" -
"/admin" -
"/adminTool" {
HTTP::respond 404 content "\
RESOURCE NOT FOUND"
}
}
}
when HTTP_REQUEST priority 501 {
Log a debug statement in a rule event with a different priority so the HTTP::uri value isn't cached.
This event can be removed after testing.
log local0. "[IP::client_addr]:[TCP::client_port]: Modified URI: [HTTP::uri]"
}
What were you trying to do with the case below? It's rewriting the path to the same as it was when requested:
"/tooljournals" { HTTP::path "/tooljournals" }
Also, if you want to use the same action for multiple cases, you can add them with hyphens as shown above for /eb-member-earAdmin, /admin and /adminTool.
Aaron
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
