Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Best way to customize resourceResolver behavior

Avatar

Former Community Member

Given an AEM 5.6.1 environment, what's the best way to use request headers to generate a resource path prefix?

For instance, suppose the locale is provided via httpRequest.getHeader("locale"), and our content is organized in the following tree:

en_US/homepage.html

ja_JP/homepage.html

How would you take a request for /homepage.html and internally prepend the locale retrieved from httpRequest.getHeader("locale")?

1 Accepted Solution

Avatar

Correct answer by
Level 9

Hi ofuangka,

   JCR resolver & mapping con't resolve at run time and configuration should exist prior. For your use case one of the option is to use apache rewrite rule. 

Thanks,

View solution in original post

3 Replies

Avatar

Former Community Member

I didn't see anything there that uses HTTP request headers for mapping.  Did I miss something?

Avatar

Correct answer by
Level 9

Hi ofuangka,

   JCR resolver & mapping con't resolve at run time and configuration should exist prior. For your use case one of the option is to use apache rewrite rule. 

Thanks,