# HTTP redirect assistance

**URL:** <https://community.f5.com/t/http-redirect-assistance/30085>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [March 5, 2009, 5:05pm UTC](https://community.f5.com/t/http-redirect-assistance/30085 "2009-03-05T17:05:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jo\_Anglin\_5148](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@Jo\_Anglin\_5148](https://community.f5.com/u/Jo_Anglin_5148)\
**Post date:** [March 5, 2009, 5:05pm UTC](https://community.f5.com/t/http-redirect-assistance/30085/1 "2009-03-05T17:05:20Z")

</div>

I have created a web server for internal use and I am having this problem.

target: [http://enabled/VenNew/version1/logon.asp](http://enabled/VenNew/version1/logon.asp)

source: [http://VenNew/version1/logon.asp](http://VenNew/version1/logon.asp)

I also want to get to the source specified when I type “enabled” from my browser.

I created this irule that didn’t work. What am I doing wroung?

when HTTP\_REQUEST {

if { [string tolower [HTTP::host]] contains “enabled” } {

HTTP::redirect "[http://VenNew/version1/logon.asp](http://VenNew/version1/logon.asp) "

}

}

---

<div class="post-metadata">

**Author:** ![lmwf1\_55268](https://avatars.discourse-cdn.com/v4/letter/l/c89c15/32.png) [@lmwf1\_55268](https://community.f5.com/u/lmwf1_55268)\
**Post date:** [March 5, 2009, 7:17pm UTC](https://community.f5.com/t/http-redirect-assistance/30085/2 "2009-03-05T19:17:00Z")

</div>

Try one of this.

when HTTP\_REQUEST {

if { [string tolower [HTTP::host]] starts\_with “enabled” } {

HTTP::redirect “[http://VenNew/version1/logon.asp](http://VenNew/version1/logon.asp)”

}

}

when HTTP\_REQUEST {

if { [HTTP::host] starts\_with “enabled” } {

HTTP::redirect “[http://VenNew/version1/logon.asp](http://VenNew/version1/logon.asp)”

}

}

---

<div class="post-metadata">

**Author:** ![Deb\_Allen\_18](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Deb\_Allen\_18](https://community.f5.com/u/Deb_Allen_18)\
**Post date:** [March 5, 2009, 9:50pm UTC](https://community.f5.com/t/http-redirect-assistance/30085/3 "2009-03-05T21:50:11Z")

</div>

is the hostname “enabled”, or is that part of the URI?
