Forum Discussion
HTTP2HTTPS HTTPS/URI issue
When you type in: www.website.xyz you go to: https://www.website.xyz/specific_uri when you type in: www.website.xyz/anotherwebpage you go to: https://www.website.xyz/anyother_uri
This is the Irule on the port 80 virtual server and is working just fine. when HTTP_REQUEST { if {[HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/specific_uri" } HTTP::redirect "https://[HTTP::host][HTTP::uri]" }
Issue comes here, I need something on the port 443 virtual server to direct it to the correct uri I can't just add another irule?? How is this possible.
When you type in: https://www.website.xyz you go to: https://www.website.xyz/specific_uri when you type in: https://www.website.xyz/anyother_uri
3 Replies
- typo....should say when you type in: www.website.xyz/anyother_uri you go to: https://www.website.xyz/anyother_uri
- Christian_30338Historic F5 Account
hello!
I am not sure if i fully understand your question. But if you want to use the same iRule on the HTTP and HTTPS virtual server try having a look at the TCP::local_port to see if the request is on port 80 or 443. Should be a simple change. Try something like the following.
when HTTP_REQUEST { if {[TCP::local_port] == 80} { do some port 80 work } otherwise do some non 80 (443) work } - Kevin_Stewart
Employee
If I understand your question, you have a redirect iRule on your port 80 VIP, which should probably look more like this:
when HTTP_REQUEST { if {[HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/specific_uri" } else { HTTP::redirect "https://[HTTP::host][HTTP::uri]" } }You can then add any iRule you need on your port 443 VIP.
when HTTP_REQUEST { if { [HTTP::uri] equals "/" } { HTTP::redirect "https://[HTTP::host]/specific_uri" } }
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