Forum Discussion
iRule to modify the URI without a client redirect
- Mar 19, 2014
You may want to look at this page:
https://devcentral.f5.com/wiki/iRules.HTTP__uri.ashx
Using a redirect will change the URL on the browser.
Changing the Host header only affects what the server gets.
You will need the IP address of la.mysite.com, say it is 1.2.3.4
You will need an irule like this:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { the node command directs the request to the server whether or not it is behind the BigIP. Make sure the BigIP has a route to that server. node 1.2.3.4 In case you don't have SNAT on the virtual, you may need it here. snat automap In case the server complains, set the host header. HTTP::header replace Host "la.mysite.com" Finally change the URI while on its way to server. HTTP::uri /documents/china.pdf } }Here is the page for the SNAT command:
https://devcentral.f5.com/wiki/iRules.snat.ashx
Here is the page for the node command:
You may want to look at this page:
https://devcentral.f5.com/wiki/iRules.HTTP__uri.ashx
Using a redirect will change the URL on the browser.
Changing the Host header only affects what the server gets.
You will need the IP address of la.mysite.com, say it is 1.2.3.4
You will need an irule like this:
when HTTP_REQUEST {
if { [HTTP::uri] equals "/" } {
the node command directs the request to the server
whether or not it is behind the BigIP. Make sure the BigIP
has a route to that server.
node 1.2.3.4
In case you don't have SNAT on the virtual, you may need it here.
snat automap
In case the server complains, set the host header.
HTTP::header replace Host "la.mysite.com"
Finally change the URI while on its way to server.
HTTP::uri /documents/china.pdf
}
}
Here is the page for the SNAT command:
https://devcentral.f5.com/wiki/iRules.snat.ashx
Here is the page for the node command:
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