Forum Discussion
ukitsysadmin_95
Nimbostratus
Nov 10, 2009Keep original URL after HTTP::redirect
Hello
Aaron kindly wrote the following irule, which works a treat, but is it possible after the redirect to keep the original url in the browser ???
when HTTP_REQUEST {
log local0. "[IP::client_addr]:[TCP::client_port]: New [HTTP::method] request to [HTTP::host][HTTP::uri]"
if { [string tolower [HTTP::host]] starts_with "preview.www."} {
log local0. "[IP::client_addr]:[TCP::client_port]: Redirecting to preview2.www.[getfield [string tolower [HTTP::host]] preview.www. 2]"
HTTP::redirect "http://preview2.www.[getfield [string tolower [HTTP::host]] preview.www. 2]" } }
although preview.www. has redirected to preview2.www can the broswer still say preview.www."any domain name"
1 Reply
- hoolio
Cirrostratus
If you want to keep the original URI, you would need to not redirect the client to a new URL. Instead you can rewrite the Host header using:
HTTP::header replace Host "preview2.www.[getfield [string tolower [HTTP::host]] preview.www. 2]"
If you want full blown proxying of the preview2 site, you could try the ProxyPass or ProxyPassV10 iRules in the Codeshare (Click here).
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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