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
| Rewrites | conf.d/rewrites/rewrite.rules |
| Variables | conf.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)