Forum Discussion

Nacho_de_Aguina's avatar
Nacho_de_Aguina
Icon for Nimbostratus rankNimbostratus
May 05, 2015

Uri redirection

Hello all I have the following problem i need to forward my http/s requests to a different directory than the user wrote at browser i mean www.mydom.com/somethingA/somethingB ---> To ---> webserver/somethingC

 

But the user should see www.mydom.com/somethingA/somethingB at browser. I user to have the same structure at webserver than the http request. Is that possible?

 

I´ve tried to modify the uri but at least at browser i see www.dom.com/somethingC and i had to add

 

when HTTP_REQUEST { set uri [string tolower [URI::decode [HTTP::uri]]]

 

if { $uri starts_with "/somethingc" } { node X 80

 

} elseif { $uri starts_with "/somethinga/somethingb" } { set uri [string map -nocase {"/somethinga/somethingb" "/somethingc"} [HTTP::uri]] log local0. "New URI = $uri" node x 80 HTTP::uri $uri

 

But this structure at the end i see at browser http://www.mydom.com/somethingc

 

Thxs Nacho