Forum Discussion
URI Translation and redirect help
Hello all;
I am using the BigIP v 11.6.
My users will in the browser put (https://abc-abc.abc.com/abc/example.asp=1) my redirect states redirect to "https://backendserver/xyc/example.asp=1" so in the Users window they are now seeing this link.
my question is can I make it so the user does NOT see that redirect link and they only see
"https://abc-abc.abc.com/abc/example.asp=1" and 1 is variable value in client and server side.
Thank you for any answers..
In that case you don't want to be doing a redirect you are wanting to rewrite the host, uri, and links. You can use proxypass for this, https://devcentral.f5.com/codeshare/proxypass-v10-v11 or your own iRule that could look something like this.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "abc-abc.abc.com"}{ HTTP::host "backendhostheader" } HTTP::uri [string map {/abc/ /xyc/} [HTTP::uri]] Disable the stream filter for all requests STREAM::disable LTM does not uncompress response content, so if the server has compression enabled and it cannot be disabled on the server, we can prevent the server from sending a compressed response by removing the compression offerings from the client HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { Replace http:// with https:// STREAM::expression {@backendserver@abc-abc.abc.com@ @/xyc/@/abc/@} Enable the stream filter for this response only STREAM::enable } }
14 Replies
- Brad_Parker_139
Nacreous
A standard http to https redirect on your HTTP VS should do what you want using this irule:
when HTTP_REQUEST { HTTP::respond 301 noserver Location "https://[HTTP::host][HTTP::uri]" }
- Fereda_187281
Nimbostratus
Hi Brad ; sorry for my mistake .I fix my question. Thanks for your answer.
- Brad_Parker
Cirrus
A standard http to https redirect on your HTTP VS should do what you want using this irule:
when HTTP_REQUEST { HTTP::respond 301 noserver Location "https://[HTTP::host][HTTP::uri]" }
- Fereda_187281
Nimbostratus
Hi Brad ; sorry for my mistake .I fix my question. Thanks for your answer.
- Brad_Parker_139
Nacreous
In that case you don't want to be doing a redirect you are wanting to rewrite the host, uri, and links. You can use proxypass for this, https://devcentral.f5.com/codeshare/proxypass-v10-v11 or your own iRule that could look something like this.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "abc-abc.abc.com"}{ HTTP::host "backendhostheader" } HTTP::uri [string map {/abc/ /xyc/} [HTTP::uri]] Disable the stream filter for all requests STREAM::disable LTM does not uncompress response content, so if the server has compression enabled and it cannot be disabled on the server, we can prevent the server from sending a compressed response by removing the compression offerings from the client HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { Replace http:// with https:// STREAM::expression {@backendserver@abc-abc.abc.com@ @/xyc/@/abc/@} Enable the stream filter for this response only STREAM::enable } }- Fereda_187281
Nimbostratus
Brad remarkeble!! It is working.But My Vip settings had not got stream check.it was selected none before so i was put the line which starts stream. Is it correct way?I think in this case te response uri include backend server hostname. So how can i hide the response? Thanks again.. - Brad_Parker_139
Nacreous
Yes, just add the default stream profile to your VIP and un-comment the STREAM commands in response to have the response re-written to mask the backend hostname and uri. - Fereda_187281
Nimbostratus
Hİ Brad Again; Thank you for your help it is good working:) And ask one thing WHy we are disable stream all via irule although bind it in properties menu. Whats the stream action in here?
- Brad_Parker
Cirrus
In that case you don't want to be doing a redirect you are wanting to rewrite the host, uri, and links. You can use proxypass for this, https://devcentral.f5.com/codeshare/proxypass-v10-v11 or your own iRule that could look something like this.
when HTTP_REQUEST { if {[string tolower [HTTP::host]] equals "abc-abc.abc.com"}{ HTTP::host "backendhostheader" } HTTP::uri [string map {/abc/ /xyc/} [HTTP::uri]] Disable the stream filter for all requests STREAM::disable LTM does not uncompress response content, so if the server has compression enabled and it cannot be disabled on the server, we can prevent the server from sending a compressed response by removing the compression offerings from the client HTTP::header remove "Accept-Encoding" } when HTTP_RESPONSE { Replace http:// with https:// STREAM::expression {@backendserver@abc-abc.abc.com@ @/xyc/@/abc/@} Enable the stream filter for this response only STREAM::enable } }- Fereda_187281
Nimbostratus
Brad remarkeble!! It is working.But My Vip settings had not got stream check.it was selected none before so i was put the line which starts stream. Is it correct way?I think in this case te response uri include backend server hostname. So how can i hide the response? Thanks again.. - Brad_Parker
Cirrus
Yes, just add the default stream profile to your VIP and un-comment the STREAM commands in response to have the response re-written to mask the backend hostname and uri. - Fereda_187281
Nimbostratus
Hİ Brad Again; Thank you for your help it is good working:) And ask one thing WHy we are disable stream all via irule although bind it in properties menu. Whats the stream action in here?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
