cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
631
Views
0
Helpful
3
Replies

layer 5 content rule match wildcard and suffix

kiwisalami
Level 1
Level 1

Is it possible on the CSS11503 to create a layer 5 content rule that matches a url "/*/_edit", so that the following example URLs are matched by the content rule:

In other words, the portion of the URL between the domain www.example.com and the suffix "/_edit" could be anything from nothing (i.e. "") to many directories.

What is between the domain name and the "_edit" suffix is not predicable - these sites (and their navigation) are published by a CMS and change regularly.

For this reason, I am unable to define content rules that are explicitly linked to the directory hierarchy.

Any help/advice very much appreciated.

Cheers,

Tom.

3 Replies 3

Daniel Arrondo Ostiz
Cisco Employee
Cisco Employee

Hi Tom,

The easiest in this case would be defining the url statement in the content rule as "url  /_edit" to match only on the last part of the url. There is no need to configure anything for the directories in the middle

I hope this helps

Daniel

Hi Daniel -thank you for your response.

I configured my rule as you suggested:

content redirect_to_cms

    vip address w.x.y.z

    redirect "http://www.google.com"

    port 80

    protocol tcp

    url "/_edit"

    active

This config catches requests for http://w.x.y.z/_edit but not for http://w.x.y.z/directory/_edit

Unfortunately, the statements url "/_*edit" or url "/*/_edit" are not accepted:

CSS11503(config-owner-content[ITS-redirect_to_cms])# url "/*/_edit"

%% Unsupported or invalid content rule URI

CSS11503(config-owner-content[ITS-redirect_to_cms])# url "/*_edit"

%% Unsupported or invalid content rule URI

CSS11503(config-owner-content[ITS-redirect_to_cms])#

Cheers,

Tom.

Hi Tom,

You are right, I was too fast in my answer.

I have done some tests in my lab and confirmed that these kind of URLs are not supported by the CSS. The "url" command syntax assumes that you are going to give the full URL, so, wildcards are not accepted.

There is one exception to that. The CSS will accept a command with the syntax "url /*.edit". In this case, it will try to match the extension of the requested url. I confirmed in my lab that, this syntax matches even if the path includes several directories.

You could try to use this exception to your benefit. If you are able to change the URL in your application to "http://www.example.com/mysite1/subdir1/subdir2/.edit", it should work properly.

Daniel

Review Cisco Networking for a $25 gift card