Forum Discussion

Rahul_Gupt_2401's avatar
Rahul_Gupt_2401
Icon for Nimbostratus rankNimbostratus
Oct 24, 2018

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 ";

 

  • Snl's avatar
    Snl
    Icon for Cirrostratus rankCirrostratus

    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]"} 
            }