Sign in to Community
Sign in to view all badges
I have a requirement related to /etc/mapping .
i have around 60+ domains in following format:
is there a way to write a common redirect rule for all domains instead of adding same redirect to all 60?
use different regex for level 2 domains vs level 3 domains
refer- https://regex101.com/ or https://regexr.com/
Oh thanks for the input.
I have something like this
Individual redirect is working so i believe i am doing something wrong in regex.
It won't work because $1 would always be null. Who is responsible to feed into $1 for "sling:match"? You can't have a $1 in "sling:match" in a normal use case.
Please share a couple of sample urls for which you need the regex.
Thanks for the response. I tried
sling:match : "$1/etc[.]clientlibs/(.+)
sling:internalRedirect : /etc.clientlibs/$2
but this is not working. can you suggest any other way?
sling.match String (.+).domains.com(/.*.html)$ --- best possible regex that you can come up with for all domains, this one is for subdomains...
sling:redirect or sling:internalRedirect ...........
Modify regex per your use case, you may require multiple rules for assets and/or libs as applicable