Forum Discussion
ppater_73099
Nimbostratus
Jul 08, 2013URL forward
Hello,
Can someone help me with creating an irule?
I want to foward the following.
http://www.example.com/test1
to
http://test1.example.com
Thanks
Best Regards
Patrick
4 Replies
- nitass
Employee
do you want redirection or rewriting?
Redirects, Rewrites and App Transfers via iRules by Colin Walker
https://devcentral.f5.com/tech-tips/articles/redirects-rewrites-and-app-transfers-via-irules - ppater_73099
Nimbostratus
it has to be an redirect
- nitass
Employee
e.g.[root@ve10:Active] config b virtual bar list virtual bar { snat automap destination 172.28.19.252:80 ip protocol 6 rules myrule profiles { http {} tcp {} } } [root@ve10:Active] config b rule myrule list rule myrule { when HTTP_REQUEST { if { [HTTP::host] eq "www.example.com" and [HTTP::uri] eq "/test1" } { HTTP::redirect "http://test1.example.com" } } } [root@ve10:Active] config curl -i http://www.example.com/test1 HTTP/1.0 302 Found Location: http://test1.example.com Server: BigIP Connection: Keep-Alive Content-Length: 0 - ppater_73099
Nimbostratus
Thank you Nitass! This works for me :)
Best Regards
Patrick
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects