Forum Discussion

saurabhk_321062's avatar
saurabhk_321062
Icon for Nimbostratus rankNimbostratus
Aug 10, 2018

Redirecting the URL to other and user cannot see the redirected URL

I need a help in creation of irule to apply on the pool. The irule should redirect the URL to the original URL in the backend. The user should not see the 302 redirect, he should only see the URL and not the original redirected URL.

 

Need to re-write http://abc.xyz.com/proxy.pac to http://abc.xyz.com:4713/files/proxy.pac on the backend. The user should only see the first URL in their browser (not a 302 redirect) and in the backend it should get redirected to http://abc.xyz.com:4713/files/proxy.pac.

 

Kindly let me know if the below irules are correct:

 

1 when HTTP_REQUEST { HTTP::header replace Host " ; }

 

2

 

if { ([HTTP::host] equals "abc.xyz.com" ) and ([HTTP::uri] starts_with "/proxy.pac") } { HTTP::header replace Host "abc.xyz.com:4713" HTTP::header replace uri "/files/proxy.pac" }

 

3

 

when HTTP_REQUEST { HTTP::header replace Host " ; }

 

Kincly let me know if the 1st irule is correct or the 2nd irule is correct. In case both are incorrect please tell us what should be the correct irule?

 

Apart from irules, can i use the rewrite profile for this..?

 

1 Reply

  • Hi,

    I think that the matching rule would be :

    when HTTP_REQUEST { 
        if { ([HTTP::host] eq "abc.xyz.com" ) and ([HTTP::path] starts_with "/proxy.pac") } {
            HTTP::header replace Host "abc.xyz.com:4713" 
            HTTP::path "/files/proxy.pac" 
        }
    }