Dispatcher Redirecting request for fonts to 404 error pages | Community
Skip to main content
Rohan_Garg
Community Advisor
Community Advisor
August 12, 2022
Solved

Dispatcher Redirecting request for fonts to 404 error pages

  • August 12, 2022
  • 2 replies
  • 2451 views

Hi All,

 

I have the below scenario - 

 

1. CSS clientlibs file calling font files via url syntax as below - 

@2375939-face{
font-family:icomoon;
src:url(clientlib-site/resources/icons/icomoon.eot?s69qo9);
src:url(clientlib-site/resources/icons/icomoon.eot?s69qo9#iefix) format("embedded-opentype"),
url(clientlib-site/resources/icons/icomoon.ttf?s69qo9) format("truetype"),
url(clientlib-site/resources/icons/icomoon.woff?s69qo9) format("woff"),
url(clientlib-site/resources/icons/icomoon.svg?s69qo9#icomoon) format("svg");

}

 

2. Behavior on Publish and Dispatcher - 

Publish - The clientlibs and the files (ttf | woff) are displaying 200 OK when hit.

Dispatcher - The clientlibs file is correctly hit but the icon files are redirecting to 404 pages.

 

Fixes Tried - 

1. Updated the VHost configuration to turn on ModMimeUsePathInfo.

ModMimeUsePathInfo On 
<IfModule mod_mime.c>
AddType application/vnd.ms-fontobject .eot
AddType application/x-font-opentype .otf
AddType image/svg+xml .svg
AddType application/x-font-ttf .ttf
AddType application/font-woff .woff
AddType application/font-woff2 .woff2
</IfModule>

 

Can you please help why the dispatcher would redirect the font request to error page with 301 ?

The other clientlibs request for CSS and JS are loading fine, the publisher is downloading the font icon when directly hit.

@gaurav-behl , @achennapragada , @arunpatidar , @mohit_kbansal , @kautuk_sahni 

 

Please find the dispatcher logs below - 

HTTPD Access Logs
cm-pxxxxx-exxxxxx-aem-publish-zzzzzzzzz-yyyyy - - 12/Aug/2022:14:12:12 +0000 "GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf?s69qo9 HTTP/1.1" 301 245 "https://brandA.com/etc.clientlibs/brandA/clientlibs/clientlib-site.lc-4475042b57b4e02f2f8147fe0b49fb14-lc.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"


cm-pxxxxx-exxxxxx-aem-publish-zzzzzzzzz-yyyyy - - 12/Aug/2022:14:12:13 +0000 "GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.woff?s69qo9 HTTP/1.1" 301 245 "https://brandA.com/etc.clientlibs/brandA/clientlibs/clientlib-site.lc-4475042b57b4e02f2f8147fe0b49fb14-lc.min.css" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"


cm-pxxxxx-exxxxxx-aem-publish-zzzzzzzzz-yyyyy - - 12/Aug/2022:14:25:36 +0000 "GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf?s69qo9 HTTP/1.1" 301 245 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"

 

Request Logs - Directly Hitting Publish
14/Aug/2022:08:46:54 +0000 [45925] -> GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf?s69qo9 HTTP/1.1 [cm-p57852-e459121-aem-publish-5498f7f4d9-rxms2]
14/Aug/2022:08:46:54 +0000 [45925] <- 200 application/x-font-ttf 9ms [cm-p57852-e459121-aem-publish-5498f7f4d9-rxms2]

 

Request Logs - When hitting same URL on dispatcher
14/Aug/2022:08:10:09 +0000 [41611] -> GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf?s69qo9 HTTP/1.1 [cm-p57852-e459121-aem-publish-5498f7f4d9-rxms2]
14/Aug/2022:08:10:09 +0000 [41611] <- 404 - 12ms [cm-p57852-e459121-aem-publish-5498f7f4d9-rxms2]

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Rohan_Garg

Hi All,

 

The problem is now resolved.

 

Checking the Publish's Error Log I found the issue below - 

14.08.2022 08:10:09.651 [cm-pxyxyx-eyyyyyy-aem-publish-54abcdefd9-rxms2] *INFO* [122.177.105.119 [1660464609650] GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.ClientLibraryProxyServlet Proxy request to /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf not supported.

 

The sling mapping for etc.clientlibs was missing in dispatcher which solved the issue.

2 replies

Level 2
August 12, 2022

Hi @rohan_garg ,

I believe it must be issue with rewrites. Can you please share the full path of the sample file (e.g. icomoon.ttf)

Rohan_Garg
Community Advisor
Community Advisor
August 12, 2022
Level 2
August 12, 2022

Hi @rohan_garg ,

Please try the following

  1. Please make sure if those file extensions are allowed in the conf.d/filters
  2. Once they are allowed in filters and still receiving 404, try adding some additional rewrite like this in your rewrites(for testing

Thanks,

Anil.

Rohan_Garg
Community Advisor
Rohan_GargCommunity AdvisorAuthorAccepted solution
Community Advisor
August 14, 2022

Hi All,

 

The problem is now resolved.

 

Checking the Publish's Error Log I found the issue below - 

14.08.2022 08:10:09.651 [cm-pxyxyx-eyyyyyy-aem-publish-54abcdefd9-rxms2] *INFO* [122.177.105.119 [1660464609650] GET /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf HTTP/1.1] com.adobe.granite.ui.clientlibs.impl.ClientLibraryProxyServlet Proxy request to /etc.clientlibs/brandA/clientlibs/clientlib-site/resources/icons/icomoon.ttf not supported.

 

The sling mapping for etc.clientlibs was missing in dispatcher which solved the issue.