Sitecore 6.5版本120247媒体网址添加了斜杠 [英] Sitecore 6.5 rev. 120247 media urls adding a leading slash

查看:72
本文介绍了Sitecore 6.5版本120247媒体网址添加了斜杠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要使用Edgecast CDN,我们必须编写一个自定义媒体提供程序,该站点在将站点从6.5 rev 111230升级到120427之前可以很好地工作.升级后,所有图像都没有显示在网站上.我调试了代码,找到了可能的原因.在升级中包括以下修复程序-

To be able to use Edgecast CDN, we had to write a custom media provider which worked well with before the site was upgraded from 6.5 rev 111230 to 120427. After the upgrade, none of the images showed up on the website. I debugged the code and found a probable cause. In the upgrade following fix was included -

默认情况下,现在将相对于站点根目录(例如/~/media/images/picture.ashx或/virtualFolder/~/media/picture.ashx)而不是相对于当前页面生成媒体URL.这样的URL被认为是SEO友好的,并且还改善了缓存. (346213,332285)

By default, media URLs will now be generated relative to the site root (such as /~/media/images/picture.ashx or /virtualFolder/~/media/picture.ashx) instead of relative to the current page. Such URLs are considered SEO friendly, and also improve caching. (346213, 332285)

这现在在媒体URL的开头添加了一个斜杠"/".因此,URL不会生成为"//mediaserver/abc.jpg".默认情况下,"MediaUrlOptions.VirtualFolder"设置为"/".我想确认这是问题所在,以及是否可以在代码中覆盖此问题,但我想确定是否可以从配置文件中进行控制在代码中进行此更改.如果这不是问题,那么如何解决此问题?

This is now adding a leading slash "/" at the beginning of the media urls. So urls are not getting generated as "//mediaserver/abc.jpg". The 'MediaUrlOptions.VirtualFolder" is being set to "/" by default. I want to confirm that this is the issue and also if I can override this in code but I want to find out if this can be controlled from the config file instead of making this change in the code.If this is not the issue then how can I fix this problem?

推荐答案

为了在此处提供答案,

删除Media.MediaLinkPrefix设置中的斜线,因为Sitecore现在会自动添加它: <setting name="Media.MediaLinkPrefix" value="/mediaserver" />

Remove the slash in the Media.MediaLinkPrefix setting due to Sitecore automatically adding it now: <setting name="Media.MediaLinkPrefix" value="/mediaserver" />

以及以下内容: <handler trigger="/mediaserver/" handler="sitecore_media.ashx" />

此外,自6.5.0版修订版以来,媒体API进行了改进. 120427.现在,可以在SDN发行说明中使用每个参考号312358的web.config设置优雅地重写MediaProvider类: http://sdn.sitecore.net/Products /Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/ChangeLog.aspx

Also, Media API improvements have been made since version 6.5.0 rev. 120427. Now it is possible to elegantly override the MediaProvider class using a web.config setting per reference number 312358 in release notes on the SDN: http://sdn.sitecore.net/Products/Sitecore%20V5/Sitecore%20CMS%206/ReleaseNotes/ChangeLog.aspx

这篇关于Sitecore 6.5版本120247媒体网址添加了斜杠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆