Forum Discussion
Puli
Nimbostratus
Aug 17, 2010re-direct a URL but maintain the same URL in browser
i have a requirement as below.
From URL : http://serverA.com/eng/test.hml
This need to be re-directed or re-written to
To : http://serverA.com/global/eng/test.html
The client browser should not show the re-directed url, it should show the original url (serverA.com/eng/test/html) but re-written to serverA.com/global/eng/test.html
Tried to replace host with serverA.com/global but does not work.
Any help is appreciated.
thanks,
Puli.
- There are two ways to change the URL. The first is issuing a redirect to the client that tells the browser to make a new request to the new URL. This will update the browser's address bar with the new URL which isn't what you want.
when HTTP_REQUEST { if { [HTTP::uri] eq "/eng/test.html" } { HTTP::uri "/global/eng/test.html" } }
- Puli
Nimbostratus
thanks joe. - Puli
Nimbostratus
Sorry Joe, - Hamish
Cirrocumulus
That's because Joes example doesn't do a redirect. It simply changes the URL that the backend sees. What you're doing is the same. But if the user types in a URL that then gets mapped to a DIRECTORY on the backend the backend WILL send a redirect. And the URL will of course change on the browser. - The_Bhattman
Nimbostratus
Hi Puli,when HTTP_REQUEST { switch [HTTP::uri] { "/eng" - "/eng/" { HTTP::uri "/eng/index.html" pool serverB_pool } "/eng/test.html" { "HTTP::uri "/global/eng/test.html" pool serverA_pool } } }
- Puli
Nimbostratus
Thanks Bhattman, - The_Bhattman
Nimbostratus
Hi Puli,when HTTP_REQUEST { HTTP::uri [string map {/global/ / } [HTTP::uri]] }
- Moe_Jartin
Cirrus
Puli, - Puli
Nimbostratus
Hi Joe,
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects