Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.
SOLVED

AEM Dispatcher ErrorDocument URL not showing up

Avatar

Community Advisor

Hi AEM Community,

 

I have the below Error Document vhost configuration written for my site -

ErrorDocument 404 /content/xyz/us/en/errors/404.html

When I am hitting an incorrect URL my dispatcher logs show the below - 

172.17.0.1 "localhost" - [05/Aug/2022:07:16:25 +0000] "GET /content/xyz/us/en/abc.html HTTP/1.1" 301 233 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0"
172.17.0.1 "localhost" - [05/Aug/2022:07:16:25 +0000] "GET /abc.html HTTP/1.1" 404 2425 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0"
[05/Aug/2022:07:16:25 +0000] "GET /content/xyz/us/en/abc.html HTTP/1.1" 404 none [publishfarm/0] 13ms "localhost"

 

The above entries are due to the below redirect rules - 

RewriteRule ^/content/xyz/us/en/(.*)$ /$1 [NE,L,R=301]
RewriteRule ^/(.*)$ /content/xyz/us/en/$1 [NC,PT,L]

 

However, once the redirection occurs and 404 was encountered I was expecting the logs to redirect to error page as defined in ErrorDocument directive.

 

Can anyone please suggest what is wrong in this ?

Currently the request passes to publish and is served with the below - 

rohangargTA_0-1659684107962.png

 



1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, I tried in local with docker image it worked for me.
Here are my changes in 

1. created new vhost file at /dispatcher-sdk-2.0.104/src/conf.d/available_vhosts/aemlab.vhost, it is a copy of /dispatcher-sdk-2.0.104/src/conf.d/available_vhosts/default.vhost but added 

<LocationMatch />
ErrorDocument 404 /content/aemlab/404.html
ErrorDocument 403 /content/aemlab/403.html
ErrorDocument 500 /content/aemlab/500.html
</LocationMatch>

2. unlink /dispatcher-sdk-2.0.104src/conf.d/enabled_vhosts/default.vhost

3. created symblink ln -s /dispatcher-sdk-2.0.104/src/conf.d/available_vhosts/aemlab.vhost /dispatcher-sdk-2.0.104/src/conf.d/enabled_vhosts/default.vhost

4. executed below command

./bin/validator full -d ./out ./src

./bin/docker_run.sh ./out host.docker.internal:4503 8080

 

arunpatidar_0-1659712514270.png

 



Arun Patidar

View solution in original post

25 Replies

Avatar

Community Advisor

Yes, you can ask the CDN team or whoever showing that message to stop showing for your website.



Arun Patidar

Avatar

Level 1

@arunpatidar can you please help me with this if the same response is coming in author instance also then i think the page is coming from AEM side only.

Avatar

Community Advisor

can you check the config where this page is setup? I believe something is overriding that response



Arun Patidar

Avatar

Community Advisor

Hi, I tried in local with docker image it worked for me.
Here are my changes in 

1. created new vhost file at /dispatcher-sdk-2.0.104/src/conf.d/available_vhosts/aemlab.vhost, it is a copy of /dispatcher-sdk-2.0.104/src/conf.d/available_vhosts/default.vhost but added 

<LocationMatch />
ErrorDocument 404 /content/aemlab/404.html
ErrorDocument 403 /content/aemlab/403.html
ErrorDocument 500 /content/aemlab/500.html
</LocationMatch>

2. unlink /dispatcher-sdk-2.0.104src/conf.d/enabled_vhosts/default.vhost

3. created symblink ln -s /dispatcher-sdk-2.0.104/src/conf.d/available_vhosts/aemlab.vhost /dispatcher-sdk-2.0.104/src/conf.d/enabled_vhosts/default.vhost

4. executed below command

./bin/validator full -d ./out ./src
./bin/docker_run.sh ./out host.docker.internal:4503 8080

 

arunpatidar_0-1659712514270.png

 



Arun Patidar