Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Restricting Query Strings in dispatcher.any not working

Avatar

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
25793466
Level 2

24-07-2018

I want to disable any URL with query strings but allow those that don't.  The "Note:" section of Configuring Dispatcher says the following should work:

/0001 { /type "deny" /method "*" /url "/mysite/content/test/*" }

/0002 { /type "allow" /method "GET" /url "/mysite/content/test/*" }

/0003 { /type "deny" /method "GET" /url "/mysite/content/test/*" /query "*" }

When I try https://my.site.com/mysite/content/test/home.html, it is getting blocked /0003

It should work, given "If a rule contains a /query, it will only match requests that contain a query string and match the provided query pattern."

For testing purposes my /filter section only contains those 3 rules.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
25793466
Level 2

10-10-2018

It turns out there is an issue with the dispatcher version we are using.  I don't know if it effects all platforms, but it is not working correctly on 4.2.0 on IIS, x64 non-ssl version.

I tested the same exact dispatcher configuration (dispatcher.any) on the latest dispatcher (v4.2.3) and the filter rules are working correctly with query strings.

Answers (6)

Answers (6)

Avatar

Avatar
Level 1
praneethm583275
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
praneethm583275
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
praneethm583275
Level 1

06-09-2018

Hi nivedtha,

I am having some doubts regarding the AEM can you please help me out

[Personal contact info removed]

Avatar

Avatar
Boost 5
Employee
Nisha_Nivedita
Employee

Likes

15 likes

Total Posts

26 posts

Correct Reply

8 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Employee
Nisha_Nivedita
Employee

Likes

15 likes

Total Posts

26 posts

Correct Reply

8 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
Nisha_Nivedita
Employee

06-09-2018

/0029 { /type "allow" /method "GET" /url "/content/geometrixx-outdoors.html" }

/0030 { /type "deny" /method "GET" /url "/content/geometrixx-outdoors.html" /query "*" }

Above should work, however content might be getting served from cache regardless of query string attached or not

Avatar

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
25793466
Level 2

25-07-2018

That didn't work.  We run AEM within an application server and it's not possible to run at the root.  (We even had ACS unseccuessufully attempt to change that).  All of our /filter rules are prefixed with /mysite and we haven't had any issues since we launched the site over two years ago.

I added a fourth rule to test your suggestion.

/0004 { /type "allow" /method "GET" /url "/content/test/*" /query "a=*" }

https://my.site.com/mysite/content/test/home.html?a=test does not work.  It does work when rule 4 is:

/0004 { /type "allow" /method "GET" /url "/mysite/content/test/*" /query "a=*" }

Avatar

Avatar
Validate 1
Level 3
GaneshM
Level 3

Likes

15 likes

Total Posts

49 posts

Correct Reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 3
GaneshM
Level 3

Likes

15 likes

Total Posts

49 posts

Correct Reply

9 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
GaneshM
Level 3

24-07-2018

Hi,

Could you please remove the "mysite" from path and try?, you need to define only AEM path which is like /content/ , /apps/ , /etc/.

Eg :

/0001 { /type "deny" /method "*" /url "/content/test/*" }

/0002 { /type "allow" /method "GET" /url "/content/test/*" }

/0003 { /type "deny" /method "GET" /url "/content/test/*" /query "*" }

Wondering why your sample dispatcher URL looks /mysite/content/test/home.html , the best practice is always starts with /content/ like mysite.com/content/test

Thanks!

Avatar

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
25793466
Level 2

Likes

3 likes

Total Posts

22 posts

Correct Reply

2 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 1
View profile
25793466
Level 2

24-07-2018

I should have mentioned that.  We are using 4.2.0 on IIS.  x64 non-ssl version.

Avatar

Avatar
Give Back 50
Employee
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile

Avatar
Give Back 50
Employee
Vish_dhaliwal
Employee

Likes

186 likes

Total Posts

356 posts

Correct Reply

123 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 10
View profile
Vish_dhaliwal
Employee

24-07-2018

Hello,

Make sure you have dispatcher version 4.1.5 or greater than 4.1.5.

Regards,

Vishu