Expand my Community achievements bar.

SOLVED

How to rewrite URL and make resourceresolver to resolve it.

Avatar

Level 2

We have a specific requirement where we have to mask /en/us/ from browser URL and replace it with /. For Example: if the link that is requested from server is http://localhost /content/category/en/us/something.html then the browser should show http://localhost/content/category/something.html in URL. But as the resource at /content/category/something.html does not exist, Sling should be able find it (through resource resolver) in /content/category/en/us/.

We do not want to use Vanity URL as that would be page specific and we are looking for a generic solution to this. We were thinking of taking the approach of stripping out /en/us/ at the dispatcher level and then doing the mapping through Sling Resolver configuration or in /etc/map. Is that a good solution? One problem with this approach is that if tomorrow we have to support /de/us/ then how would it be mapped by Sling Resolver to /de/us. What are the available solutions for achieving this?

1 Accepted Solution

Avatar

Correct answer by
Level 10
2 Replies

Avatar

Correct answer by
Level 10

You need to use combination of mod_rewrite + sling resolver. Can't achieve with single layer. More details refer [0].   When you add new region you can map it again using Sling Resolver. Example at [1].

[0]

https://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_domains.html

http://www.cognifide.com/blogs/cq/multidomain-cq-mappings-and-apache-configuration/

http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-adobe-experience-manager.html

 

 

[1]  http://helpx.adobe.com/experience-manager/kb/HowToMapDomains.html

Avatar

Level 2

Sham HC wrote...

You need to use combination of mod_rewrite + sling resolver. Can't achieve with single layer. More details refer [0].   When you add new region you can map it again using Sling Resolver. Example at [1].

[0]

https://dev.day.com/docs/en/cq/current/deploying/dispatcher/disp_domains.html

http://www.cognifide.com/blogs/cq/multidomain-cq-mappings-and-apache-configuration/

http://www.citytechinc.com/us/en/blog/2013/04/extensionless-urls-in-adobe-experience-manager.html

 

 

[1]  http://helpx.adobe.com/experience-manager/kb/HowToMapDomains.html

 

 

Thanks , It was resolved using dispatcher.