Restrict page.json to 404 page on aem 6.4 dispatcher

Avatar

Avatar

farahz913310

Avatar

farahz913310

farahz913310

25-02-2019

Hi Team,

I am setting up the  dispatcher configuration for my site.

I need to restrict page.json to redirect to my site  404 page .

Can anyone help me on this .

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

26-02-2019

If you want to disable the .json extension for all pages, I would recommend to reconfigure the Default Get Servlet and disable the JSON extension alltogether; that's the most reliable and easy to solve this problem. Do this only on publish, author instance requires that this is turned on.

Jörg

Answers (4)

Answers (4)

Avatar

Avatar

farahz913310

Avatar

farahz913310

farahz913310

25-02-2019

Thanks @jorg. Just wanted to confirm ,adding these filters in my dispatcher ,will it cater for all urls if I insert .json at the end of  any url will it go to my custom  404 page.

Currently 404 is served from Apache

Avatar

Avatar

farahz913310

Avatar

farahz913310

farahz913310

25-02-2019

I am facing  a security issue if  user type .json at the end of url ,hence want it to go to my custom 404 page whenever user type .json at the end of any page url.

404 page is served by Apache currently

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

25-02-2019

/filter

  /0001 { glob "/home.json" /type "allow" }

/0002 { type "deny" /extension "json"}

Avatar

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281

Avatar

Gaurav-Behl

MVP

Total Posts

1.1K

Likes

226

Correct Answer

281
Gaurav-Behl
MVP

25-02-2019

do you want to restrict "page.json" or  do you want to redirect it to 404 page?

is your 404 page served via apache or AEM?