Forum Discussion
HTTP Redirect from intranet to internet site
I am wanting to create a redirect using and internal DNS name that redirects to an external one. EX: http://internal.mycompany.com redirects to http://mycompany.f5.com
I have configured a VIP on the LTM that is internal.mycompany.com and created the following iRule
when HTTP_REQUEST { HTTP::redirect "https://mycompany.f5.com/?whr=tetrapak.com[HTTP::uri]" } This iRule is being attached to the VIP in the iRule section. At this point I am not getting redirected. I have looked up the iRule but can't seem to find the complete picture on how to set this up. Can someone help please?
It needs to be:
when HTTP_REQUEST { HTTP::respond 301 "Location" "https://mycompany.f5.com[HTTP::uri]?whr=tetrapak.com" }HTTP::uri is caps sensitive.
8 Replies
- Joseph_Johnson_
Nimbostratus
Try this:
when HTTP_REQUEST { HTTP::respond 301 "Location" "http://mycompany.f5.com[HTTP::uri]?whr=tetrapak" }
- Matt_A_184631
Nimbostratus
Thanks for the help but I get the following error when trying to update the iRule
01070151:3: Rule [/Common/RedirectTest] error: /Common/RedirectTest:2: error: [undefined procedure: HTTP::URI][HTTP::URI]
- Matt_A_184631
Nimbostratus
Here is the new iRule:
when HTTP_REQUEST { HTTP::respond 301 "Location" "https://mycompany.f5.com[HTTP::URI]?whr=tetrapak.com" }
- cjbarr1234
Altostratus
I ran into this a while ago and that iRule works really well. I had some mega issues though with SSL sites. I dealt with a SaaS company that I wanted to do the same thing. Glad you had this work out!
- Brad_Parker_139
Nacreous
It needs to be:
when HTTP_REQUEST { HTTP::respond 301 "Location" "https://mycompany.f5.com[HTTP::uri]?whr=tetrapak.com" }HTTP::uri is caps sensitive.
- Matt_A_184631
Nimbostratus
That did it..Thanks a lot for this it would have taken me forever to figure it out.
- Brad_Parker
Cirrus
It needs to be:
when HTTP_REQUEST { HTTP::respond 301 "Location" "https://mycompany.f5.com[HTTP::uri]?whr=tetrapak.com" }HTTP::uri is caps sensitive.
- Matt_A_184631
Nimbostratus
That did it..Thanks a lot for this it would have taken me forever to figure it out.
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
