첫 번째 단계는, 올바르게 설정을 오류 처리기를 가지고있다 위치를 응답 상태에 적절한 에러 코드를 설정하고있다. 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);
}
%>
다음 단계는 아파치/운영자 (가상 호스트 구성에서 구성) 정확한 오류 문서를로드하도록 구성하는 것이다. 오류 페이지의 적절한 로딩이 아파치/디스패처에 위임이 방법 - 구성 위
<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>
이 패턴에서 짧은 URL을 기반으로는 /content/secondapp/country-x/en/.*
가 to /country-4/en/.*
단축 이며, 각 사이트는 자신의 error.html 페이지가 및 not-found.html