Forum Discussion

Karthik_Krishn1's avatar
Karthik_Krishn1
Icon for Cirrostratus rankCirrostratus
Feb 13, 2013

Redirect SAP HTTPS portal to correct url

Hello,

 

I am new to F5 and am working od setting up the F5 for SAP portal . We have the VIP's etc setup and working . We also have the HTTP redirect working .ie when a user types in http://portal.x.com they are redirected to https://portal.x.com/irj/portal . My question is how can i do the same thing when a user driectly connects to https://portal.x.com and i redirect the session to https://portal.x.com/irj/portal.

 

I am not sure on how to do this and any help would be sincerely appreciated.

 

Thanks,

 

Karthik

 

 

 

10 Replies

  • F5Hovey_37123's avatar
    F5Hovey_37123
    Historic F5 Account
    Hi Karthik,

     

     

    Redirect iRules are super common where you have SAP or not. There is a ton of content on DevCentral you can leverage. One of my favorite is the Group "iRule Redirection Generator" at https://devcentral.f5.com/community/group/asg/10. Let me know if it helps or you need more.

     

     

    Craig

     

  • Hi Craig ,

     

    Thank you for your reply . I tried the rule generator but it did not work for me . Our HTTP to HTTPS redirect is working fine but the issue i am having is that when a client goes directly to the HTTPS link they do not get to the correct path .

     

    This is what our HTTP-HTTPS redirect does..

     

    User --- http://example_portal.company.com --- https://example_portal.company.com/irj/portal

     

    This is what happens when they go directly to the HTTPs link..

     

    User -- https://example_portal.company.com -- https://example_portal.company.com/index.html

     

    This is what needs to happen when a client goes directly to the HTTPS link..

     

    User -- https://example_portal.company.com -- https://example_portal.company.com/irj/portal

     

     

    Thanks and I sincerely appreciate your help.

     

     

    Karthik

     

     

     

  • Are you terminating the SSL/TLS on the F5? If you are this will be easy, please confirm.
  • OK, thanks. Sorry, one more question, are you running this all through a single VS or two, one for 80, one for 443?
  • Hi Steve,

     

     

    Two VS .. one for 80 and one for 443 . The VS for 80 does the HTTP-HTTPS redirect which is working.
  • OK, so this should work for both Virtual Servers;

    
    when HTTP_REQUEST {
     if { [HTTP::uri] equals "/" } {
     HTTP::redirect "https://[HTTP::host]/irj/portal"
     }
    }