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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to have more than 1 rewrite.rules file in aem as a cloud dispatcher

Avatar

Level 2

How to have more than 1 rewrite.rules file in aem as a cloud dispatcher
I have created opt-in/USE_SOURCES_DIRECTLY but still its throwing validation errors following this document
https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delive...

Any help on remaining part of the process would be great to have

 

Ralph8_0-1634134590581.png

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

According to the troubleshooting docs, the custom rewrite rules can be added into rewrite.rule and defualt_rewrite.rule is optional to add.

included file (…) does not match any known file

There are two types of files in your Apache virtual host configuration that can be specified as includes: rewrites and variables. The included files need to be named as follows:

Type Include file name

Rewritesconf.d/rewrites/rewrite.rules
Variablesconf.d/variables/custom.vars

Alternatively, you can include the default version of the rewrite rules, whose name is conf.d/rewrites/default_rewrite.rules. Note, that there is no default version of the variables files.

 

And as you already mentioned that the new flexible mode does not have this limitation, did you tried with new Flexible mode

  • Flexible mode - the recommended mode, and the default for AEM archetype 28 and higher, which is also used by Cloud Manager for new environments created after the Cloud Manager 2021.7.0 release. Customers can activate this mode by adding the folder and file opt-in/USE_SOURCES_DIRECTLY. By using this more flexible mode, there are no limitations in the file structure under the rewrites folder that in legacy mode required a single rewrite.rules file. Also, there is no limitation on the number of rules you can add. For for details on folder structure and local validation see Validating and Debugging using Dispatcher Tools.

  • Legacy mode - for details on the folder structure and local validation for dispatcher configuration legacy mode, see Validating and Debugging using Dispatcher Tools (Legacy)

View solution in original post

1 Reply

Avatar

Community Advisor

Hi @Ralph8 ,

       There is no much diffrence in  normal dispatcher and Adobe cloud dispatcher.

In Adobe cloud dispatcher you need to add your rewrite file and use dispatcher validater to make the correction of path.

 

Regards,

Sanjay

Avatar

Level 2

Hi @Sanjay_Bangar,

The dispatcher validator is breaking here when its finding a different rewrite.rule file.

Just trying to understand how to add multiple rewrite.rules because the validator is performing some checks to make sure things work.

Regards
Ralph

Avatar

Community Advisor

1.  in this case as  'rewrites' files can be specified as includes vhost configuration files:

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delive...

2. While converting from AMS to AEM cloud dispatcher, it is mentioned to "Remove allowlists"

- Remove the folder conf.d/whitelists and remove Include statements in the virtual host files referring to
some file in that subfolder.

https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delive...

3. You can refer/ use Dispatcher Converter Tool if trying to migrate from AMS dispatcher configs to AEM cloud:

Avatar

Level 2

Hi Arun,

The rewrite.rules and the default_rewrite.rules seems to work but why can't we have any other custom rewrite.rules file but as per the following attached pic from Adobe site it should technically work.


Also in my case i am having more than 400 rewrite rules so segregating them into domain wise different files would be kind of a better option to avoid mishaps.

Ralph8_0-1634541742377.png

Link to site - https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delive...

Regards
Ralph

Avatar

Correct answer by
Community Advisor

Hi,

According to the troubleshooting docs, the custom rewrite rules can be added into rewrite.rule and defualt_rewrite.rule is optional to add.

included file (…) does not match any known file

There are two types of files in your Apache virtual host configuration that can be specified as includes: rewrites and variables. The included files need to be named as follows:

Type Include file name

Rewritesconf.d/rewrites/rewrite.rules
Variablesconf.d/variables/custom.vars

Alternatively, you can include the default version of the rewrite rules, whose name is conf.d/rewrites/default_rewrite.rules. Note, that there is no default version of the variables files.

 

And as you already mentioned that the new flexible mode does not have this limitation, did you tried with new Flexible mode

  • Flexible mode - the recommended mode, and the default for AEM archetype 28 and higher, which is also used by Cloud Manager for new environments created after the Cloud Manager 2021.7.0 release. Customers can activate this mode by adding the folder and file opt-in/USE_SOURCES_DIRECTLY. By using this more flexible mode, there are no limitations in the file structure under the rewrites folder that in legacy mode required a single rewrite.rules file. Also, there is no limitation on the number of rules you can add. For for details on folder structure and local validation see Validating and Debugging using Dispatcher Tools.

  • Legacy mode - for details on the folder structure and local validation for dispatcher configuration legacy mode, see Validating and Debugging using Dispatcher Tools (Legacy)

Avatar

Level 2

i had tried and it didnt work, even Adobe support guys mentioned that the feature doesnt work.
Not sure why its advertised if its not supported.