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=2...
hoolio
Cirrostratus
Feb 03, 2010Hi Joe,
You could use [HTTP::uri] starts_with "/admin" or [string match "/admin*" [HTTP::uri]] to check if the URI starts with /admin. But the * with eq is interpreted literally, not as a wildcard. Also, you can remove the switch statement as you want to include the URI for the redirect whether it's / or something longer.
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/admin" } {
HTTP::redirect "http://legacy.ourwebsite.org[HTTP::uri]"
}
}
Aaron
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