Expand my Community achievements bar.

SOLVED

How to have more than 1 rewrite.rules FOLDERS but not files in aem as a cloud dispatcher

Avatar

Level 1

Hello,

 

I'm using Flexible mode mode (opt-in/USE_SOURCES_DIRECTLY) for my dispatcher configs in the AEM cloud, and when I try to add a custom FOLDER to conf.d/rewrites,

e.g

(conf.d/rewrites/CUSTOM_FOLDER_A/CUSTOM_REWRITE_FOR_A.rules)

(conf.d/rewrites/CUSTOM_FOLDER_B/CUSTOM_REWRITE_FOR_B.rules)

 

I see the following error while executing in the console.

"cp: can't create CUSTOM_FOLDER/CUSTOM_REWRITE.rules"

 

But when I add CUSTOM_REWRITE.rules right under conf.d/rewrites/ it works 

 

The problem only with additional folders under rewrites directory

My goal is to have multiple rewrite configurations for each web site and each website should have its own directory under conf.d/rewrites/ 

Example :

conf.d/rewrites/SITE-A/...

conf.d/rewrites/SITE-B/...

 

Do u have any idea how can I resolve this issue?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@ArturGrigoryan No that won't work in AEMaaCS. I have mentioned the same reason in the about comment.

 

Below link is the Adobe Open sourced AEM dispatcher docker container  (Just FYI)

https://github.com/adobe/aem-dispatcher-docker

 

View solution in original post

3 Replies

Avatar

Community Advisor

@ArturGrigoryan I faced this issue  

 

In AEMaaCS the dispatcher is managed by Adobe and there are certain restrictions on what can be configured by customers. This includes the ability to write custom rewrite rules in the dispatcher.

 

The reason for this restriction is to ensure the security and stability of the AEMaacs platform. Adobe manages the dispatcher configuration to ensure that it meets the security standards and best practices of the platform. Allowing customers to write custom rewrite rules could potentially introduce security vulnerabilities or cause the dispatcher to behave in unexpected ways, which could impact the overall stability of the platform.

 

But you can write the custom rules by putting it directly in rewrite.rules file

Hello ,

 

Thank you for you reply.

I have already configured as you said my custom rules in rewrite.rules file

But I would like to know if it's possible to have custom folders under conf.d/rewrites

I include all rewrite rules from .vhost file

 

<IfModule mod_rewrite.c>

 

RewriteEngine on

Include conf.d/rewrites/rewrite.rules

Include conf.d/rewrites/CUSTOM.rules

#MY QUESTION : AND HERE I WANT TO HAVE SOMETHING LIKE THIS,IS IT POSSIBLE?

Include conf.d/rewrites/CUSTOM_FOLDER/CUSTOM.rules

 

</IfModule>

 

Usually it should work like that since I specifically say from which path to take my configurations

But for me when I try to execute this I see error

1.jpg

Avatar

Correct answer by
Community Advisor

@ArturGrigoryan No that won't work in AEMaaCS. I have mentioned the same reason in the about comment.

 

Below link is the Adobe Open sourced AEM dispatcher docker container  (Just FYI)

https://github.com/adobe/aem-dispatcher-docker