How to rewrite URL and make resourceresolver to resolve it. | Community
Skip to main content
abhishek_09
Level 2
October 16, 2015
Solved

How to rewrite URL and make resourceresolver to resolve it.

  • October 16, 2015
  • 2 replies
  • 960 views

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?

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 Sham_HC

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

2 replies

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

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

abhishek_09
Level 2
October 16, 2015

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.