Forum Discussion
External to internal redirection
Hello Everybody, Can you please help me, i want to redirect an URL ( External URL ) to another URL (internal URL published in a VS) ad if i must use an irule or just a policy redirection, Example: ---->
my greetings,
- Andy_McGrath
Cumulonimbus
When you say redirect are you trying to send a HTTP redirect back to the client or are you trying to simply forward the traffic on to a different virtual server and update the HTTP Host header in the request?
If you want to just forward from one Virtual Server to another you can use the
command the following is an example iRule to change the host header and forward to another Virtual Server namedvirtual
but only if the host header in the client request is/partitionName/www.test2.com_vs
www.test1.com
when HTTP_REQUEST { if {[string tolower [HTTP::host]] eq "www.test1.com"} { HTTP::header replace Host "www.test2.com" virtual /partitionName/www.test2.com_vs } }
This does however comes with a whole set of issues you need to look at, like if the second Virtual Server returns HTML links with absolute path (i.e. includes the FQDN) you are likely to need to rewrite them with a STREAM profile. Also need to what out if you are performing SSL off-load on both Virtual Servers as the forward from the initial VS would create an SSL error.
I am sure some other things to watch out for but depends on your configuration.
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