Forum Discussion
vikram_95579
Nimbostratus
Jan 29, 2008URL Redirect
Hello All,
I am new to iRule. Can someone help me with my problem of URL Redirect ?
Problem:
Source URL: http://sample.abc.com/sample/abc.dll?queryStr=sample&...
hoolio
Cirrostratus
Feb 05, 2008Hi eramosipn,
It would be better to create a new post detailing what you're trying to do.
If you want to redirect specific requests to a new URL, you can create an iRule which checks the requested URI and issues a redirect. Here is an example:
when RULE_INIT {
Log debug messages to /var/log/ltm? 1=yes, 0=no.
set ::redirect_debug 1
}
when HTTP_REQUEST {
Log the URI and path
if {$::redirect_debug}{log local0. "Requested URI: [HTTP::uri], requested path: [HTTP::path]"}
Check if the path is the one we're looking for
if {[HTTP::path] eq /portalwap.wml}{
if {$::redirect_debug}{log local0. "Redirecting client [IP::client_addr] "}
Send a 302 redirect to the client
HTTP::redirect http://mitelcel.example.com:7015/PortalUMTS/UMTS/
}
}You can check the wiki pages for the commands to get more detail:
Events (Click here)
HTTP_REQUEST (Click here)
HTTP::uri (Click here)
HTTP::path (Click here)
HTTP::redirect (Click here)
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