0

we are using Sitecore 9.0.2, sitecore sxa 1.7.1

enter image description here

In Content Delivery site, we are showing full image path like:

/-/media/Project/MyTest/MyTenant/mytestsite/TestImage.jpg?h=168&la=en&w=300&hash=FFB1492C0D4A2198E64AD69B5EC73AA1)

User can easily identity the image path(please refer the above image).
Is there any option to avoid to show full (image/pdf) path OR is it possible to short item path or any other way to solve this issue

Example : Image, pdf file

3

You can use Media.UseItemPaths setting and set it to false:

<setting name="Media.UseItemPaths" value="false" />

Then your media links will use short ID of media items instead of the full path like :

<img src="/-/media/8FA551CAE3544FEDBAD801FB826033C9.png" />

But why would you want to do this? What is wrong with url like

<img src="/-/media/Project/MyTest/MyTenant/mytestsite/TestImage.jpg?h=168&la=en&w=300&hash=FFB1492C0D4A2198E64AD69B5EC73AA1" />

The full media path is needed for Sitecore to determine which media item should be returned for given link. You either need that or ID of the item, there is no other way.

1
  • Is there any options to show short URL in images(only for images)
    – PKH
    Jun 2 '19 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.