Forum Discussion
Chenco_322726
Nimbostratus
Apr 11, 2018Redirect specifc URI to another URL
Hello,
I tried to find on google but nothing matched my search.
I need a simple redirect from only to > https://www.anotherdomain.com/test/event/841/seatplan/
Any suggestions ?
Thanks!
youssef1
Cumulonimbus
Apr 11, 2018Hello,
You can use this irule no matter the number of the ticket. the ticket number can be dynamic and I think it's your need.
when HTTP_REQUEST {
set hostname [string tolower [HTTP::host]]
set uri [string tolower [HTTP::uri]]
if {$host eq "www.domain.com" && $uri starts_with "/tickets/" }{
set numberticket [string range $uri 9 end]
set redirecturi "/test/event/$numberticket/seatplan/"
HTTP::redirect "https://www.anotherdomain.com$redirecturi"
}
}
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