Forum Discussion
irule for appending a URI to the URL
Hi experts, i am new with irules. My requirement is - https://example.com to get re-directed to https://example.com/test/mypage
Please advise?
12 Replies
- nathe
Cirrocumulus
few options depending on if there are any more specifics to your use case. here are two:
when HTTP_REQUEST { HTTP::uri "/test/mypage" }or
when HTTP_REQUEST { if { [HTTP::path] equals "/" } { HTTP::uri "/test/mypage" } }Check out the iRules wiki for help with any other requirements. Loads of examples to help.
N
- Mariappan_S_156
Nimbostratus
Hi,
Pls try below.
when HTTP_REQUEST { if { [HTTP::host] equals "https://example.com" } { HTTP::redirect "https://example.com/test/mypage" } }
Regards, Mariappan S
- sandy16
Altostratus
None of these is working for me. It does NOT get redirected to the proper URI.
- Brad_Parker
Cirrus
Give this a try:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/test/mypage" } }Also, it looks like you're trying to do this on HTTPS, is your virtual server SSL? If so you will require a client SSL profile and an HTTP profile to do this. If you want HTTPS terminated at the server, you will also need to use a server SSL profile.
- sandy16
Altostratus
Brad, that worked...thanks.. Cheers !! - Brad_Parker
Cirrus
Please, mark as answered. - nathe
Cirrocumulus
Good one Brad
- Brad_Parker_139
Nacreous
Give this a try:
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/test/mypage" } }Also, it looks like you're trying to do this on HTTPS, is your virtual server SSL? If so you will require a client SSL profile and an HTTP profile to do this. If you want HTTPS terminated at the server, you will also need to use a server SSL profile.
- sandy16
Altostratus
Brad, that worked...thanks.. Cheers !! - Brad_Parker_139
Nacreous
Please, mark as answered. - nathe
Cirrocumulus
Good one Brad
- sandy16
Altostratus
I will try this. I am applying this irule on a SSL VS. It`s a case of end-to-end SSL to i have a client and a server SSL profile applied. The VS works if i open the exact url/uri which is: https://example.com/test/mypage whereas does NOT give me the proper page/content with https://example.com
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