How to have more than 1 rewrite.rules file in aem as a cloud dispatcher | Community
Skip to main content
Level 2
October 13, 2021
Solved

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

  • October 13, 2021
  • 2 replies
  • 5776 views

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-delivery/validation-debug.html?lang=en#first-phase

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

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

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)

2 replies

Sanjay_Bangar
Community Advisor
Community Advisor
October 13, 2021

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

Ralph8Author
Level 2
October 13, 2021

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

Sanjay_Bangar
Community Advisor
Community Advisor
October 13, 2021

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:

arunpatidar
Community Advisor
Community Advisor
October 15, 2021

Hi,

Can you check if is works or not if you inlcude default file and custom file to rewrite.rules file

e.g.

https://github.com/arunpatidar02/aemaacs-aemlab/tree/master/dispatcher.cloud/src/conf.d/rewrites

Arun Patidar
Ralph8Author
Level 2
October 18, 2021

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.

Link to site - https://experienceleague.adobe.com/docs/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html?lang=en

Regards
Ralph

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
October 18, 2021

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)

Arun Patidar