attachment path

Peter M asked on August 24, 2016 16:15

Hi,

We have a field (for ex image2) defined as text but form control is “media selection”. So now if I upload an image as an attachment via media libraries tab, Everything is fine: When I do in transformation <img src="<%# Eval("Image2")%>" /> - everything is ok – no rewrites or redirects! perfectly rendered. No rewrites or redirects.

BUT if If instead of using media libraries I use attachments tab the transformation will render it like

The problem is that this https://www.mysite.com/getattachment/SpecialPages/test/Peter-Article-Test/cms_job.gif.aspx?width=48&height=48&ext=.gif will be redirected/rewritten to https://www.mysite.com/NavExp/files/18/18a53cc1-8765-4fd3-9744-097bcf92d6c9.gif when a browser is downloading this image.

This rewrite is not good from SEO prospective and we need to avoid it.

Is there a way to render the final URL?

Thanks, Peter

Correct Answer

Peter M answered on August 25, 2016 17:31

This case is the configuration settings: \System\Performance\Redirect files to disk - must be unchecked.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Chetan Sharma answered on August 24, 2016 17:28

<%# GetAttachmentUrl(Eval<string>("AttachmentName"), Eval<string>("NodeAliasPath")) %>

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.