# URL Redirect

**URL:** <https://community.f5.com/t/url-redirect/4279>\
**Category:** Technical Forums\
**Tags:** availability, irules, devops, ltm, application-delivery\
**Created:** [October 19, 2015, 6:49pm UTC](https://community.f5.com/t/url-redirect/4279 "2015-10-19T18:49:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jose\_Loera\_1179](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@Jose\_Loera\_1179](https://community.f5.com/u/Jose_Loera_1179)\
**Post date:** [October 19, 2015, 6:49pm UTC](https://community.f5.com/t/url-redirect/4279/1 "2015-10-19T18:49:09Z")

</div>

I have a VIP that I would like to redirect to a URL that looks like this…

I want the user to type in the Vip IP or A record and resolved to one of the nodes in the pool similar to whats is below..

[host] /login.asp

new to iRules, so please help with this.

---

<div class="post-metadata">

**Author:** ![Brad\_Parker](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Brad\_Parker](https://community.f5.com/u/Brad_Parker)\
**Post date:** [October 19, 2015, 7:10pm UTC](https://community.f5.com/t/url-redirect/4279/2 "2015-10-19T19:10:23Z")

</div>

can you clarify what you are trying to do a little more. Your question is a little vague.

---

<div class="post-metadata">

**Author:** ![Jose\_Loera\_1179](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@Jose\_Loera\_1179](https://community.f5.com/u/Jose_Loera_1179)\
**Post date:** [October 19, 2015, 7:16pm UTC](https://community.f5.com/t/url-redirect/4279/3 "2015-10-19T19:16:45Z")

</div>

Absolutely sorry… here is what I am trying to do.

I have a pool with each node having a login page example: and

I also have a Virtual Server with ip example: 10.1.1.1 and I want to type in the VIP ip as followed [http://10.1.1.1](http://10.1.1.1) and redirect it to a client node on the pool.. http://[node]/login.asp

please let me know if this help

---

<div class="post-metadata">

**Author:** ![Brad\_Parker](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Brad\_Parker](https://community.f5.com/u/Brad_Parker)\
**Post date:** [October 19, 2015, 7:39pm UTC](https://community.f5.com/t/url-redirect/4279/4 "2015-10-19T19:39:10Z")

</div>

Sounds more like you want to re-write the hostname than a redirect. This iRule could do something simple like rewriting the request’s host header to the IP address of the chosen pool member.

```tcl
when HTTP_REQUEST {
    HTTP::host [LB::server addr]
}

```

---

<div class="post-metadata">

**Author:** ![Jose\_Loera\_1179](https://avatars.discourse-cdn.com/v4/letter/j/a4c791/32.png) [@Jose\_Loera\_1179](https://community.f5.com/u/Jose_Loera_1179)\
**Post date:** [October 19, 2015, 7:44pm UTC](https://community.f5.com/t/url-redirect/4279/5 "2015-10-19T19:44:14Z")

</div>

Thanks Brad, so if I type in my browser will it redirect it to a node in the pool?

---

<div class="post-metadata">

**Author:** ![Brad\_Parker](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@Brad\_Parker](https://community.f5.com/u/Brad_Parker)\
**Post date:** [October 19, 2015, 7:47pm UTC](https://community.f5.com/t/url-redirect/4279/6 "2015-10-19T19:47:45Z")

</div>

it will not “redirect” the request. A redirect sends a 301 or 302 to the client. That means they wouldn’t be hitting your VIP and more. It will load balance to the select pool member and rewrite the host header to the http request to IP of the pool member. The users browser will not see the rewrite.
