Forum Discussion

brent112_11716's avatar
brent112_11716
Icon for Nimbostratus rankNimbostratus
Sep 21, 2012

URL Redirect never works first time

i have a simple irule that redirects users to a longer URL that we do not want them to have to remember.

 

when HTTP_REQUEST {

 

switch -glob [string tolower [HTTP::uri]] {

 

"/" {

 

HTTP::redirect "https://[HTTP::host]/psp/HRDEV91/?cmd=login&languageCd=ENG"

 

}

 

}

 

}

 

 

This irule NEVER works the first time a PC goes to https://website/ you get a page cannot be displayed. If you type it in again it redirect just like it should and all subsequent attempts to go to the root URL redirect you to the appropriate site. This happens from every PC i try it on. Any ideas what the problem could be?

 

4 Replies

  • Hi Brent,

     

     

    Do you have any other iRules enabled on the virtual server? Or any modules like WAM or ASM?

     

     

    Do you see any errors in /var/log/ltm when you reproduce the issue?

     

     

    Which LTM version are you running? Assuming 10.x+, can you run 'tmsh list ltm virtual VS_NAME' and post an anonymized copy of the virtual server config?

     

     

    Aaron
  • No other irules, we have ASM but it is not enabled on this virtual server. We are running version 11.2

     

    i ran that command and the virtual server that i created does not show there, could it be because i used an iapp to create it?

     

  • If it's part of the iApp, it would be in a folder:

     

     

    tmsh

     

    cd FOLDER_NAME

     

    list ltm virtual VS_NAME

     

     

    Aaron
  • Is there a difference between the "first time" being "http://www.example.com" or "http://www.example.com/"

     

     

    Presence, or lack thereof, of a trailing slash messing things up for you?