AEM As A Cloud Service - Dispatcher - Error page for multiple countries and languages | Adobe Higher Education
Skip to main content
Adobe Employee
July 11, 2022

AEM As A Cloud Service - Dispatcher - Error page for multiple countries and languages

  • July 11, 2022
  • 3 の返信
  • 2730 ビュー

Hi,

 

I'm working on the error page for multiple countries and languages. I'm using the ACS common for error handling and have one domain for all countries and languages.

Content structure : 

/content/company/de/en/....

/content/company/de/de/....

/content/company/fr/en/....

/content/company/fr/fr/....

 

I am implementing region specific vhost and rewrite rules.
For example
company.fr/en/home123.html -> company.fr/content/company/fr/en/home123.html.
Unfortunately, the error pages doesn't get mapped properly for 'FR'. Although, it works well for 'DE'.
ISSUE : Error page isn't mapped properly for the non-existing FR pages.
Observations :
  1. Doesn't work on the server dispatcher for FR, but works well on my local and server publsiher
  2. Error pages are available on server, if requested individually.
  3. Dispatcher configs and rewrite rules works fine for all the existing pages for DE and FR.
Attaching screenshots for references. Any suggestion would be helpful.
 

 

このトピックへの返信は締め切られました。

3 の返信

arunpatidar
Community Advisor
Community Advisor
July 11, 2022

Hi,

In case of 404, you need to set status 404 and defined error pages for domains.

You can use the various conditions to defined page per domain.

 

The error pages can be hosted i AEM for each domain

 

<LocationMatch "/de/en/(.*)">
ErrorDocument 404 /de/en/404.html
</LocationMatch>
<LocationMatch "/fr/en/(.*)">
ErrorDocument 404 /fr/en/404.html
</LocationMatch>

Arun Patidar
hiral-shahAdobe Employee作成者
Adobe Employee
July 11, 2022

Hi Arun,

 

Thanks for the quick response.
I do have the ErrorDocument property set in the vhost files (both DE and FR) : 

DE vhost : ErrorDocument 404 /de/errors/404.html

FR vhost : ErrorDocument 404 /fr/errors/404.html

 

Thanks,

Hiral

Jagadeesh_Prakash
Community Advisor
Community Advisor
July 11, 2022

@hiral-shah It should work with @arunpatidar  Solution. But if it is not working the issue is with some thing else.

And also i see fromt he screenshot attached

 

why on dispatcher we are rendering from /content/<name>/fr/content/<name>/fr/fr/home1234.html

 

What is the exact ur from publisher? There is some rule or any configuration that is redirecting /content/fr on top of /content/<name>/fr. Please check from that prespective

July 11, 2022

Hi Jagadeesh,

 

I am trying to find the reason for /content/<name>/fr on top of the URL.

But my main query is - the existing pages for FR are getting mapped properly with the same set of rules. Also, the response from the publisher is 404 and that is why the error page is getting mapped on publisher. 404 is responded to the dispatcher as well but error page is not mapped in this case.

 

Thanks,

Hiral

arunpatidar
Community Advisor
Community Advisor
July 11, 2022

The error page you are receiving right now is from AEM. In this case custom the error page should be return. Can you also check if the error page is published or not?

Arun Patidar
hiral-shahAdobe Employee作成者
Adobe Employee
July 13, 2022

Hello @arunpatidar @jagadeesh_prakash,

 

Here is the snippet from the log files : 

Dispatcher logs :
dispatcher access log - "GET /fr/testagain.html HTTP/1.1" 404 237 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"
aem dispatcher log - "GET /content/company/fr/fr/testagain.html" 40451ms [companypublishfarm/0] [actionnone] dev.company.fr

 

Publisher logs :
request log -
[792] -> GET /content/company/fr/fr/testagain.html HTTP/1.1
[792] <- 404 text/html 34ms
error log - GET /content/company/fr/fr/testagain.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Resource /content/company/fr/content/company/fr/fr/testagain.html not found
access log - "GET /content/company/fr/fr/testagain.html HTTP/1.1" 404 455 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36"

There is not much in the logs.