Forum Discussion
redirect to new path
looking at what you wanted to do, Redirect> https://abc.com/site1/online/index.html to this site > https://abc.com/online/index.html I would do that using this irule with an external data group and apply the irule to your VIP hosting abc.com
Create external data group name REDIR 1st create a text file on your workstation called REDIR and add this line to it "/site1/online/index.html" := "abc.com/online/index.html" save the file REDIR.txt From Local Traffic > iRules : Data Group List click Create Data Group name REDIR Type External File import your file set File Contents to String Key / Value Pair Separator := Data Group Name REDIR click on Import
Now build the irule which references the external data group iRule called REDIR
when HTTP_REQUEST {
set urlredir [class match -value [HTTP::uri] contains REDIR]
if { $urlredir ne "" }{
log local0. "REDIRECT - path : [HTTP::path] - referrer : [HTTP::header "Referer"]"
set redir [string map "[HTTP::path] $urlredir" [HTTP::uri] ]
HTTP::redirect "https://$redir"
}
}
apply the iRule to the VIP. You can add as many Redirects to the external file that you want. the file is stored in System > File Management : Data Group File List
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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