Forum Discussion

Joe_5599_134300's avatar
Joe_5599_134300
Icon for Nimbostratus rankNimbostratus
Oct 02, 2013

Best way to add URI at end of URL

What would be the best way with an irule to append /mobile/cplogin.aspx to a default URL of https://testsiteone@xyz.com Basically need users redirected to https://testsiteone@xyz.com/mobile/cplogin.aspx

 

Thanks Joe

 

6 Replies

  • You can use the following irule to do that:

    when HTTP_REQUEST {
       HTTP::redirect https://[HTTP::host]/mobile/cplogin.aspx
    } 
    
  • Are you sure about that '@'? Anyway, assuming it should be a period '.';

    when HTTP_REQUEST {
     if { [HTTP::uri]] equals "/" } {
     HTTP::redirect https://[[HTTP::host]]/mobile/cplogin.aspx }
    }
    
  • Try this:

    when HTTP_REQUEST {
        if { [HTTP::uri] equals "/" } {
            HTTP::redirect "https://[HTTP::host]/mobile/cplogin.aspx"
        }
    }
    

    Do you specifically mean "testsiteone@xyz.com", with an ampersand in the URL?

  • This essentially means "if the URI is blank (you didn't enter a URI in the request), the redirect to the /mobile URI". If you don't specify a URI in the request, it will always at the very least equal "/". You need a conditional check like this to prevent a loop.