Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

By default links to items from the Sitecore media library are generated using the extension .ashx. This works fine but it isn’t very good from a seo point of view. It would be better if links to media library items are generated using a proper extension (for example .txt for a text file or .jpg for a jpeg image).

Fortunately this is possible by changing the value of the key “Media.RequestExtension” in the web.config. The default value is “ashx”. If you change it to an empty value, the actual extension of the content of the media library item will be used. This is also clearly documented by the comment preceding this key:

      The extension to use in media request URLs.
      If the value is not set, the Extension field of the individual media items will be used (ie. JPG, GIF, etc.)
      Default value: "ashx"
<setting name="Media.RequestExtension" value=""/>

There is however a big disadvantage to changing this key after your site has gone into production. That disadvantage is that this change only affects links to media library items which have been added after the value of this key has been changed. So all links to media library items added before this change will continue to use the .ashx extension.

 © Evident Interactive BV