DAM image URL Mapping with resource resolver mapping (etc/map) | Community
Skip to main content
New Participant
October 16, 2015
Solved

DAM image URL Mapping with resource resolver mapping (etc/map)

  • October 16, 2015
  • 10 replies
  • 3699 views

Can we do resource resolver mapping for DAM URLs like for content path we can?

Lets say we have a DAM URL like (/content/dam/test/en_us/footer.png), in publisher we can refer that image like http://localhost:4503/content/dam/test/en_us/footer.png

and we have dispatcher configured for the above publisher , where Images are getting cached.

But when we go to the site via dispatcher Eg. apache server , we get the image URLS like a relative URL like /content/dam/test/en_us/footer.png.

Can we do some resolver mapping , so that request coming with /content/dam/test -> http://test.example.com/content/dam/test.

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

10 replies

July 20, 2016
Lokesh_Shivalingaiah
New Participant
October 16, 2015

If you have used the relative path, then it should append the domain. it depends on how you are getting the path of the image.

Kunal_Gaba_
New Participant
October 16, 2015

You can do this by following the steps listed in the following page - http://www.cqblueprints.com/tipsandtricks/serving-static-assets-alt-url.html

New Participant
October 16, 2015

I have tried this, but still no expected result .

 

Attaching etc/map

[img]Capture.PNG[/img]

Kunal_Gaba_
New Participant
October 16, 2015

Did you create a custom request rewriter as mentioned in the article  ? 

New Participant
October 16, 2015

Custom request writer i did not try, but i tried with the etc/map configuration.

other content URls are mapped to respective path, 

    Eg. /content/test/en_us -> http://test.example.com/content/test/en_us

         /content/test1/en_us -> http://test.example.com/content/test1/en_us

but /content/dam -> http://test.example.com/content/dam is not happening.

Is there any other configuration needs to be set from system/console/bundles?

Kunal_Gaba_
New Participant
October 16, 2015

The default request rewriter in CQ does not rewrite URLs if they do not have HTML extensions. And therefore the DAM urls are not rewritten. You will have to implement a custom request rewriter to achieve rewriting of DAM urls. The same is mentioned in the article I had shared earlier. You can refer to the example code for the rewriter here - http://dev.cqblueprints.com/nexus/content/repositories/releases/com/cqblueprints/cqblueprints-all-resources-request-rewriter/1.0.0/

New Participant
October 16, 2015

Thanks for the help, custom CQ request writer solves the issue.smiley

New Participant
October 16, 2015

If i Want to create a custom request writer service like blue prints project, need small help.

I have created one java class like attached, i have used this in my existing bundle.

Service being registered , but its not rewriting the URLs,

Is there anything i am missing for this?

Sham_HC
Sham_HCAccepted solution
New Participant
October 16, 2015