Options

redirect-rewrite -http template

hi All,

Do any one has issues using rewrite redirect option in http template .

its pretty simple requirement any request with / need to redirect to /login.jsp

rewrite option i used was
https://abc.com/ ---- https://abc.com/login.jsp

and it never worked any help much appreciated .

FYI , im also using the same template to host switch i.e based on host headers select respective pool.

host switch ( configured as )

contains abc.com service group pool1
contains xyz.com service group pool2

Comments

  • Options
    siddharthaasiddharthaa Member, Administrator admin
    edited March 2017
    Hi

    If you are terminating the SSL connection on the ADC, you can use aFleX to redirect the request.

    Example: In my setup I was able to redirect https://example.com/ to https://example.com/heartbeat.php as follows:

    when HTTP_REQUEST {
    if { ([HTTP::host] eq "example.com") and ([HTTP::uri] eq "/") } {
    HTTP::redirect "https://example.com/heartbeat.php"
    }
    }

    You can customize this for your use-case.

    Regards.
  • Options
    edited March 2017
    Hi Shiva,

    Also for reference, there a subtle inference in the documentation for Host/URL switching that says you can only use either host switching or url switching in an http template...not both. So if you are using http template for host switching, then you'll have to use the aflex provided to do url switching.

    You can configure an HTTP template with one of the following service-group switching options:
    • URL switching – Selects a service group based on the URL path in the GET line of the HTTP request’s header
    • Host switching – Selects a service group based on the domain name in the Host field of the HTTP request’s header
Sign In or Register to comment.