Forum Discussion

Luca_55898's avatar
Icon for Nimbostratus rankNimbostratus
Aug 18, 2011

http URL to HTTPS URL redirect with URI

I need to be able to redirect incomming requests on a HTTP URL to a HTTPS URL with URI.



So what that means is I need: to redirect to



I already have a HTTP and HTTPS VIP. The HTTP already redirects to HTTPS.


However i had to use some HTTP classes to redirect to different pools based on the URI.



How can i do this and maintain my existing HTTP class configs?


3 Replies

  • HTTP Vip


    HTTP class


    Redirect to https://[HTTP::host][HTTP::uri]





    Your existing classes.



    If you want to match anything on the HTTP VIP then put it above the http -> https class above.



    Kevin (Jarvil)
  • Sorry i don't quite understand.



    The HTTP to HTTPS redirect is working fine.



    What i need to do is redirect either http or https to


  • Then put a HTTP class as already shown on the HTTP VIP to redirect to HTTPS. Then on the HTTPS VIP, add HTTP class with a URI match for / and redirect to the URL you want.



    If you want iRules then on the HTTP VIP



    when HTTP_REQUEST {


    HTTP::redirect "https://[HTTP::host][HTTP::uri]"





    then on the HTTPS VIP ...



    when HTTP_REQUEST {


    if { [HTTP::uri] equals "/" } {


    HTTP::redirect "https://[HTTP::host]/page1/logon.html"







    Classes are simpler to manage.



    Kevin (Jarvil)