Expand my Community achievements bar.

SOLVED

Advanced Dispatcher rules (eg. regex)

Avatar

Former Community Member

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

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

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

View solution in original post

4 Replies

Avatar

Employee

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]+ 

 

 

 

 

Avatar

Correct answer by
Employee Advisor

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

Avatar

Former Community Member

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.

Avatar

Employee

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.