Jump to content
Welcome to our new Citrix community!

Append a slash to URL if it isnt there


Rondall Stewart

Recommended Posts

We are using NetScaler 13.0 to direct several URLs to the proper internal path.  Users hit our sights with Name1.example.com, name2...., etc...  I use the below policies to manipulate the URLs

 

Name.1.example.com works and redirects to https://internal.example.com/Exampledirectory/ without issue.  The problem comes in when https://Name.1.example.com/Exampledirectory is manually without the tailing "/".  Is there a way to append the "/" at the end of the URL if it is not there?

 

 

 

 

 show responder action Exampledirectory
        Name: Exampledirectory
        Operation: redirect
        Target: "/Exampledirectory/"
        ResponseCode: 302


 show responder policy Exampledirectory_res_pol
        Name: Exampledirectory_res_pol
        Rule: HTTP.REQ.HOSTNAME.EQ("Name1.example.com") && HTTP.REQ.URL.EQ("/")
        Responder Action: Exampledirectory
        UndefAction: Use Global
        LogAction: None
        Hits: 5091
        Undef Hits: 0


 show transform action Av2Name1.example.com
        Name: Av2Name1.example.com
                Profile: Av2Exampledirectory
                Priority: 101   State: ENABLED
                reqUrlFrom: https://Name1.example.com/
                reqUrlInto: https://internal.example.com/
                resUrlFrom: https://internal.example.com/
                resUrlInto: https://Name1.example.com/
                cookieDomainFrom: Name1.example.com
                cookieDomainInto: internal.example.com
        Comment: New URL transformation for Exampledirectory

show transform policy Av2Exampledirectory-Pol
        Name: Av2Exampledirectory-Pol
        Rule: HTTP.REQ.HOSTNAME.EQ("Name1.example.com")
        Profile: Av2Exampledirectory
        Hits: 1271617
        Undef Hits: 0

Link to comment
Share on other sites

Why don't you use something like HTTP.REQ.URL.EQ("my/URL") || Why don't you use something like HTTP.REQ.URL.EQ("my/URL/")?

 

You could also use HTTP.REQ.URL.REGEX_MATCH(re//my/url/?) (the ? means, 0 or 1 of the previous character)

 

Greetings from Austria, marry Christmas

 

Johannes Norz

CTA, CCI, CCE-N

https://norz.at

https://wonderkitchen.network

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...