Content rules - beginner question

0

I am new to KEMP's Content Rules section and having read the guide I just need a tiny bit of help

We have 2 VIPs/Services www.ourdomain.com and www1.ourdomain.com

I am trying to set up a pair of basic rules (and they very nearly work!) on www1.ourdomain.com

Intended Behaviour:
A request with www1.ourdomain.com/FolderA - do nothing to the Host or URL
A request with www1.ourdomain.com/FolderB - change the Host to www.ourdomain.com, and maintain the rest of the URL

I have set up 2 rules and it partially works

Rule Name: FolderB
Content Matching 
Type: Regex
Pattern: /^\/folderB.*
Set Flag 1

Rule Name: www1Towww
Replace Header
Pattern: /www1.ourdomain.com/
Replacement: www.ourdomain.com
Only if Flag 1 set

It works fine if I visit www1.ourdomain.com/FolderB
But not if I add anything after the /FolderB, even this doesn't work www1.ourdomain.com/FolderB/

Running version:  7.1.35.2.13977

I would really appreciate any help, thank you in advance

 

1 comment

Avatar
0
Tony Vaughan

Morning,
your logic looks correct, but from what you are saying the flag isn't being matched correctly

if you haven't done so already would use be able to test with Sub-VSs?

main VS (Content Match to FolderB) -> Sub VS 1 -> header modification rule to change domain
main VS (Content Match to default) -> Sub VS 2 -> no other rules

this is to make sure that the "set Flag on match" is set and that the "match on flag set" is triggered