URL Mapping based on Resource resolver in AEM

前端 未结 1 1876
耶瑟儿~
耶瑟儿~ 2021-01-16 00:13

We have the following website structure:

content
    mysite
         en
          home
             testlevel1page
               testlevel2page
相关标签:
1条回答
  • 2021-01-16 00:45

    Under the /etc/map/http directory, add a node "www.mysite.com" and give this a sling:internalRedirect property of /content/mysite/en/home.

    As per the Sling documentation, this will "prefix the URI paths of the requests sent to this domain with the string" — i.e. in this case, appending "/content/my/en/home" after the domain name for any incoming requests to "www.mysite.com".

    Optionally, if you place this under /etc/map.publish/http, this will only be applied to instances with a Sling run mode set to publish.

    (As the rule is under a node called 'http', this won't be applied to secure requests. If you need to cater for 'https' too, you could copy the http node, or preferrably create a regex — this isn't as common a use case, but more info on the docs linked above.)

    0 讨论(0)
提交回复
热议问题