我想知道AEM中对于具有不同内容结构的多租户应用程序的错误处理。我的应用程序步骤如下:
/content/firstapp/en
---- Difficulty in the multicountry and multitenancy
/content/secondapp/country-1/en
/content/secondapp/country-2/en
/content/secondapp/country-3/en
/contente/thirdapp/en
Please suggest in this case someone implemented this kind of structure in the past or have more information to do this approachae,. thanks, Sandeep发布于 2016-07-25 11:25:28
第一步是正确设置错误处理程序,其中您在响应状态中设置了正确的错误代码。
404配置404.jsp的错误处理程序示例
<%
if (com.day.cq.wcm.api.WCMMode.fromRequest(request) != com.day.cq.wcm.api.WCMMode.DISABLED) {
%>
<%@include file="/libs/sling/servlet/errorhandler/404.jsp"%>
<%
} else {
response.setStatus(404);
}
%>下一步是将apache/dispatcher配置为加载正确的错误文档( Virtual host config中的配置)。这样,错误页面的正确加载被委托给apache/dispatcher -
<LocationMatch "^/content/secondapp/country-1/en/.*$">
ErrorDocument 404 "/country-1/not-found.html"
ErrorDocument 500 "/country-1/error.html"
</LocationMatch>
<LocationMatch "^/content/secondapp/country-2/en/.*$">
ErrorDocument 404 "/country-2/not-found.html"
ErrorDocument 500 "/country-2/error.html"
</LocationMatch>
<LocationMatch "^/content/secondapp/country-3/en/.*$">
ErrorDocument 404 "/country-3/not-found.html"
ErrorDocument 500 "/country-3/error.html"
</LocationMatch>
<LocationMatch "^/content/secondapp/country-4/en/.*$">
ErrorDocument 404 "/country-4/not-found.html"
ErrorDocument 500 "/country-4/error.html"
</LocationMatch>上面的配置是基于短to /country-4/en/.*的,其中模式是/content/secondapp/country-x/en/.*缩短URL,并且每个站点都有自己的error.html页面和not-fin.html
https://stackoverflow.com/questions/38557545
复制相似问题