Forum Discussion

kamlyada_209668's avatar
kamlyada_209668
Icon for Nimbostratus rankNimbostratus
Jun 17, 2016

Need an Irule for the mentioned url

Hello,

 

I need an Irule for below redirection-

 

When user will reach URL starting with alfresco-euro.kamlesh.com:2095/alfresco/webdav/** then VIP should call ** For all other URL, VIP will call ** or **

 

Kindly help me on the above redirection.Thanks in advance.

 

Regards Kamlesh Y

 

2 Replies

  • Assuming that you are looking for redirect:

    when HTTP_REQUEST {
    if { ([HTTP::host] eq "alfresco-euro.kamlesh.com:2095") and ([HTTP::uri] starts_with "/alfresco/webdav/") } {
    HTTP::respond 301 Location "http://A92SV00694KAM:2095[HTTP::uri]"
    } else {
    HTTP::respond 301 Location "http://A92SV00695KAM:2095/"
    }
    }
    
  • If you wanted to drop the "/alresco/webdav", you would have to replace the 2nd redirect:

    HTTP::respond 301 Location "http://A92SV00695KAM:2095/"

    with something like this:

    HTTP::respond 301 Location "http://A92SV00695KAM:2095/[string map {"/alfresco/webdav/" "/"} [HTTP::uri]]"