Forum Discussion
Joe_Pipitone
Nimbostratus
Feb 03, 2010Rewrite / redirect from /admin
I am trying to redirect and rewrite all requests to a directory, as well as any arguments that are passed through the request.
For example:
http://ourwebsite.org/admin/leads.asp?id=234&pid=193
should rewrite to:
http://legacy.ourwebsite.org//admin/leads.asp?id=234&pid=193
The following iRule below does not work - any ideas why?
when HTTP_REQUEST {
if { ([HTTP::uri] eq "/admin*") } {
switch -glob [HTTP::uri] {
"/" { HTTP::redirect "http://legacy.ourwebsite.org" }
default { HTTP::redirect "http://legacy.ourwebsite.org[HTTP::uri]" }
}
}
}
- Joe_Pipitone
Nimbostratus
Turns out this iRule worked instead: - hoolio
Cirrostratus
Hi Joe,when HTTP_REQUEST { if { [HTTP::uri] starts_with "/admin" } { HTTP::redirect "http://legacy.ourwebsite.org[HTTP::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