F5 is upgrading its customer support chat feature on My.F5.com. Chat support will be unavailable from 6am-10am PST on 1/20/26. Refer to K000159584 for details.

Forum Discussion

Michael_107360's avatar
Dec 10, 2013

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_30338's avatar
    Christian_30338
    Historic 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
    }
    
  • 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"
        }
    }