Forum Discussion
iRule to add uri after "/"
I've got a web server that hits IIS. I need an iRule that basically says if there nothing after the "/" put "XXXXX" in. For examply, users will navigate to wms-xxx.domain.com and get the IIS page. I want this to redirect them to wms-xxx.domain.com/xxxxxx
when HTTP_REQUEST { if {( [HTTP::uri] equals "/" )} { HTTP::respond "https://wms-ind.smcusa.com/wmsprod log local0. "in HTTP_REQUEST"
5 Replies
- Kevin_Stewart
Employee
Pretty close:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://wms-ind.smcusa.com/wmsprod" } } - RyanF5_169352
Nimbostratus
it's not redirecting to the /wmsprod. I have another rule in place that reverts HTTP to HTTPS but that shouldn't impose on this rule.
- Kevin_Stewart
Employee
Conceivably you should only have the HTTP-to-HTTPS iRule on the HTTP VIP, while the above should only be on the HTTPS VIP.
- RyanF5_169352
Nimbostratus
It actually worked after I applied it to both HTTP VIP and the HTTP VIP. Thanks for your help!
- Arie
Altostratus
Don't forget to consider other URLs to the root, like /default.aspx.
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