I'm running into an issue with the dispatcher validator complaining that my custom rewrite file is not found and curious if anyone has had a similar issue.
This is a pretty basic setup so far as the project is just getting going. It is for a new AEMaaCS impl so no conversions from old Apache/Dispatcher configs.
We have copied the default.vhost file and renamed appropriately and created a symlink to the file in the enabled_vhosts folder.
In the vhost file we have the following include:
Include conf.d/rewrites/client_rewrite.rules
in the conf.d/rewrites folder created a client_rewrite.rules file and place some basic rewrites for the homepage.
When running the validator (Version 2.0.32) it stops and says this file cannot be found.
I've verified the file exists and is properly named, verified the file permissions and that the file can be read.
If we change the include and file name to just rewrite.rules the file is found and everything works fine. Changing the include and filename to anything else causes the file to not be found.
It seems like the validator simply does not like rewrite files named something other than the default rewrite.rules. Are multiple rewrite files not allowed anymore?
Here are some steps to reproduce this issue:
mvn -B archetype:generate \
-D archetypeGroupId=com.adobe.aem \
-D archetypeArtifactId=aem-project-archetype \
-D archetypeVersion=27 \
-D appTitle="My Site" \
-D appId="mysite" \
-D groupId="com.mysite" \
-D aemVersion=cloud
cp mysite/dispatcher.cloud/src/conf.d/rewrites/rewrite.rules mysite/dispatcher.cloud/src/conf.d/rewrites/my_rewrite.rules
#
# This file contains the rewrite rules, and can be customized.
#
# By default, it includes just the rewrite rules. You can
# add rewrite rules to this file but you should still include
# the default rewrite rules.
Include conf.d/rewrites/default_rewrite.rules
Include conf.d/rewrites/my_rewrite.rules
./bin/validate.sh ~/projects/test-site/mysite/dispatcher.cloud/src
Phase 1: Dispatcher validator
Cloud manager validator 2.0.32
2021/06/14 14:59:22 conf.d/rewrites/rewrite.rules:9: included file (conf.d/rewrites/my_rewrite.rules) does not match any known file
Many clients have multiple vhosts and different rewrites/redirects that need to be implemented on a per vhost basis. Either there is something I'm doing wrong or this seems like a giant misstep.
@bmccurdy As per the documentation.
"Currently, a single rewrite file must be used rather than files that are site-specific. As a rule, the sum of the contents of the customizable files must be less than 1MB."
Also search for "included file (…) does not match any known file" to find the error related to your issue
This limitation is both arbitrary and crippling. We just wasted days on the same issue. Its going to make maintenance of our vhost specific and shared rewrite rules a nightmare.
Hi @bmccurdy
My guess is that the restrictions you mentioned are inherent with the "Legacy mode" of Dispatcher configurations.
With AEM archetype 28 Adobe has released a "Flexible mode" of Dispatcher configurations which doesn't have these limitations.
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.
Adobe Docs Ref -
Regards,
Amber
Views
Replies
Total Likes