AEM 6.4 | Apache Dispatcher rewrite rule to restrict classic ui authoring and exclude for one

Avatar

Avatar

kotisyamala

Avatar

kotisyamala

kotisyamala

27-05-2019

We have a use case where classic UI authoring should not be allowed if author tries with cf# then it should redirect to sites.html. but for only one page we need to allow the classic ui authoring?

Tired with rewrite rule for "cf" to redirect to sites.html but how to exclude one case such as allow for "content/myproject/testpage"?

Thanks,

koti

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

996

Correct Reply

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

996

Correct Reply

1.0K
Jörg_Hoh
Employee

28-05-2019

If the URL is /cf#/content/geometrixx/en.html, the browser sends only a request to /cf. The anchor (which is the part following the # character) is not sent because by definition it only has a meaning to a browser.

You cannot use rewrites to achieve this behavior.

Jörg

Answers (3)

Answers (3)

Avatar

Avatar

Andrew_Khoury

Employee

Avatar

Andrew_Khoury

Employee

Andrew_Khoury
Employee

30-05-2019

Since the anchor isn't sent to the server you could add javascript to the client library category loaded for the /cf URL.  /cf is handled by this node /libs/wcm/core/content/contentfinder which loads javascript for the "contentfinder" xtype - /libs/cq/ui/widgets/source/widgets/wcm/ContentFinder.js.  So you could overlay /libs/cq/ui/widgets/source/widgets/wcm/ContentFinder.js under /apps/cq/ui/widgets/source/widgets/wcm/ContentFinder.js with your custom logic.

Avatar

Avatar

Andrew_Khoury

Employee

Avatar

Andrew_Khoury

Employee

Andrew_Khoury
Employee

30-05-2019

This may not work as Joerg has mentioned because the anchor doesn't get sent to the server.

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

861

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

861
Arun_Patidar
MVP

28-05-2019

Hi,

You can trying writing a sling filter to check URL and redirect.

Example :

aem63app-repo/CustomScreenFilter.java at master · arunpatidar02/aem63app-repo · GitHub