Forum Discussion
Shivam_84461
Nimbostratus
May 21, 2015Problem with URL redirection
I wanted to redirect the webpages on this condition
if http://xyz.com/j/k/l
redirect to www.abc.com
if http://xyz.com
redirect to https://xyz.com/a/b
When I configured the irule, first part is ...
Michael_Yates
Nimbostratus
May 21, 2015Yep. That's why it's not working. You don't have that URI Listed in the iRule.
If you want that to redirect then replace/add "/dfg/fgh/wer.do" into the switch statement.
~~~
when HTTP_REQUEST {
switch -glob [ string tolower [HTTP::uri]] {
"/j/k/l*" { HTTP::redirect "http://www.abc.com" }
"/dfg/fgh/wer.do*" { HTTP::redirect "http://www.abc.com" }
"/" { HTTP::redirect "https://xyz.com/a/b" }
default {
if { [TCP::local_port] != 443 } {
HTTP::redirect "https://[HTTP::host][HTTP::uri]"
}
}
}
}
~~~
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