Forum Discussion
redirection but url not change on browser
Requirement: My company URL shop.company.com need to redirect to the one external public URL suppose http://www.cisco.com/web/partners/index.html but user will only see shop.company.com. When I tried the Nitass iRule I am able to reach but not getting through URI part.
you have to manipulate path of all the objects inside the page.
for example, in the cisco index.html may have several objects such as image, css. if they are using absolute path, no change is needed. anyway, if they are using relative path, you have to add /web/partners/ (because it is related to /web/partners/ not /).
hope this helps.
- Ashish_Ram_Tak1Dec 11, 2014
Nimbostratus
Hello Nitass, I have tried that option but not working, please find the below iRule I am also attaching the iRules which I have tried. when HTTP_REQUEST { HTTP::collect NAME::lookup www.cisco.com/ } when NAME_RESOLVED { if { [HTTP::uri] eq "/try" } { HTTP::header replace Host "www.cisco.com/web/partners/" HTTP::uri "/" node [NAME::response] 80 } else { pool foo1 } snat automap HTTP::release } - Ashish_Ram_Tak1Dec 11, 2014
Nimbostratus
i Rule 2 when RULE_INIT { set doSSL 0 } when HTTP_REQUEST { HTTP::header remove "Accept-Encoding" switch [string tolower [HTTP::host]] { "shop.company.com" { if {([HTTP::path] eq "/")} { HTTP::header replace Host "company.force.com" HTTP::uri "/shop/" } pool company.force.com } default { } } } when SERVER_CONNECTED { log local0. "pool [LB::server pool]" if {[string tolower [LB::server pool]] contains "company.force.com" } { SSL::enable serverside } else { SSL::disable serverside log local0. "ssl disabled" } } - Ashish_Ram_Tak1Dec 11, 2014
Nimbostratus
iRule 3 when HTTP_REQUEST { set host_header_value "http://company.force.com/" if {([HTTP::host] contains "shop.company.com")} { HTTP::header replace Host $host_header_value HTTP::uri "/shop/" log local0. "[IP::client_addr]:[TCP::client_port]: Replaced Host header with $host_header_value." pool company.force.com } else { } } when HTTP_RESPONSE { if {([HTTP::header exists "Location"]) && ([HTTP::header "Location"] contains "company.force.com")} { HTTP::header replace "Location" "http://shop.company.com" log local0. "Replaced Location header in response." } }
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
