Advanced Dispatcher rules (eg. regex) | Community
Skip to main content
October 16, 2015
Solved

Advanced Dispatcher rules (eg. regex)

  • October 16, 2015
  • 4 replies
  • 4179 views

Hi,

I'm trying to add some advanced rules to the Dispatcher (4.1.9) but I'm finding myself very limited by the way patterns have to be written. [1] Is there any reason why it doesn't just use regex?

How would I implement rules like these with the current patterns?

  1. Only allow query parameters "q" and "fq". Saying /query "q=*&fq=*" allows everything because of the * I can't even say "q" OR "fq"
  2. Specify the number of characters (regex: {3}) [a-zA-Z0-9] only matches one character but I want to be able to say 'match unlimited number of this'.

In addition to these pattern issues, does anybody have resources for the new vanity url feature in 4.1.9?

[1] http://docs.adobe.com/docs/en/dispatcher/disp-config.html#Designing Patterns for glob Properties

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Hi,

ATM there only globs. If you need regex support for filter rules, you could implement them also on the webserver/httpd level.

kind regards,
Jörg

4 replies

Adobe Employee
October 16, 2015

the vanity url feature is explained here http://dev.day.com/content/ddc/en/gems/dispatcher-caching---new-features-and-optimizations.html.

1. can be done by denying every param in the first line and then allowing q in the second line and allowing fq in third line      

 2. Nt sure about 2. The regex would be [a-zA-Z0-9]+ 

 

 

 

 
joerghoh
Adobe Employee
joerghohAdobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

Hi,

ATM there only globs. If you need regex support for filter rules, you could implement them also on the webserver/httpd level.

kind regards,
Jörg

October 16, 2015

Yeah, I saw the vanity url feature "explained" in the web cast, but couldn't find details anywhere. For example, where can I get the servlet that creates the vanity url list on the AEM side (the path referenced in the example doesn't exist for me)? 

 

  1. That seems awfully manual, doesn't it? Also, how do I allow unlimited number of "fq" parameters? 
  2. Yeah, with a regex that'd be easy but I don't see a way to do that with the Dsipatcher pattern.
Adobe Employee
October 16, 2015

For vanity urls, you would need vanityurls-1.0.1.zip.Please raise a support ticket to get this if you cant find in package share.