Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

Irule for a pega application

Hi, could someone please help me with an irule for below requirement:

We have 4 URL's : A, B, C and D

The VIP X needs to be configured with an irule such that whenever users hits the browser with URL A, irule captures the URL and execute the request with the URI "/prweb" added at the end of the link. For eg.

when HTTP_REQUEST_SEND { clientside { HTTP::header insert PegaRULES-SetContextURI "https://A/prweb";

0
Rate this Question
Comments on this Question
Comment made 5 months ago by snl 511

try this (not tested)

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] ends_with "a.com" } {
     HTTP::header insert PegaRULES-SetContextURI https://a/prweb/ }{
        HTTP::redirect "https://a.com/prweb[HTTP::uri]"}
    if { [string tolower [HTTP::host]] ends_with "b.com" } {
     HTTP::header insert PegaRULES-SetContextURI https://b/prweb/ }{
        HTTP::redirect "https://b.com/prweb[HTTP::uri]"} 
    if { [string tolower [HTTP::host]] ends_with "c.com" } {
     HTTP::header insert PegaRULES-SetContextURI https://c/prweb/ }{
        HTTP::redirect "https://c.com/prweb[HTTP::uri]"} 
    if { [string tolower [HTTP::host]] ends_with "d.com" } {
     HTTP::header insert PegaRULES-SetContextURI https://d/prweb/ }{
        HTTP::redirect "https://d.com/prweb[HTTP::uri]"} 
        }
0

Answers to this Question