简体   繁体   English

SharePoint删除URL的尾部斜杠

[英]SharePoint removing trailing slashes in URL's

I'm havig an issue with SharePoint 2010 Removing trailing slashes from URL's; 我遇到SharePoint 2010的问题,即从URL删除尾部斜杠。 I have 3 scenarios where this happens outlined below: ( all are happening on a Publishing Site ) 我在3种情况下概述了这种情况:(所有情况都发生在发布网站上)

If I have a Summary Links Web Part and setup a link, let's say to an external site, that requires a trailing slash, when the page is saved it is removed and the link no longer works. 如果我有一个“摘要链接” Web部件并设置了一个链接,比方说到一个外部站点,该站点需要一个斜杠,保存页面时将其删除,并且该链接不再起作用。 I have tried adding 2 slashes as suggested by some googling, this works the 1st time you save the page as the last slash is removed, but edit the page again and save, and again the other slash is removed. 我尝试按照某些谷歌搜索的建议添加2个斜杠,这在第一次保存页面时会起作用,因为删除了最后一个斜杠,但是再次编辑页面并保存,然后再次删除了另一个斜杠。

The second scenario, which is far more serious, is I have created a custom Master Page, with some static links embeded in it, and as before require the trailing slash. 第二种情况(更严重的是)是我创建了一个自定义母版页,其中嵌入了一些静态链接,并且像以前一样需要尾部斜杠。 When I changed the Alternate Access mappings in Central Admin( because I was putting a new site from development into Production with existing DNS entries on our network...) SharePoint somehow removed all trailing slashes from Links in my master page; 当我在Central Admin中更改“备用访问”映射时(因为我正在将开发中的新站点投入生产,并且网络上已有DNS条目...),SharePoint某种程度上从我的母版页链接中删除了所有斜杠; what's even worse is that there was no version created, no way to revert it except manually checkout and re-edit the page and check it in again. 更糟糕的是,没有创建任何版本,除了手动检出并重新编辑页面然后再次检入外,无法还原它。 This scenario, because no checkout or versioning happened, makes me think that a database procedure or routine fired that removed the slashes. 这种情况下,因为未发生任何检出或版本控制,所以使我认为触发了除去斜杠的数据库过程或例程。

The 3rd scenario is the same as the second except I moved a site using the Manage Content and Structure underneath another one. 第三种情况与第二种情况相同,除了我在另一个下面使用“管理内容和结构”移动了一个站点。

I don't know if these are the only time it happens, haven't had tme to test any other scenarios. 我不知道这是否是唯一的一次,还没来得及测试任何其他情况。

OK to my question, is this a setting or feature of SharePoint 2010 that can be turned off? 对于我的问题,这是可以关闭的SharePoint 2010的设置或功能吗? or is it sounding more like a BUG 还是听起来更像是一个错误

I'd love to say "you shouldn't need the trailing slash as required" but unfortunately reality does not always support that. 我很想说“您不需要按要求添加斜杠”,但是不幸的是,现实并不总是支持这一点。

Regarding the Summary Links webpart. 关于“摘要链接” Webpart。 Have you tried writing it the long way around with a Content Editor Web Part or a Links list and then adding a Links webpart to the page? 您是否尝试过使用Content Editor Web部件或“链接”列表编写较长的代码,然后在页面中添加“链接” WebPart?

2nd/3rd scenario: Are you sure they links are correct after checking in the master page? 第二种/第三种情况:签入母版页后,您确定它们的链接正确吗? Could you try to add the links on the fly with javascript? 您可以尝试使用JavaScript动态添加链接吗? Not great performance-wise, but it buy you some time to figure it out the correct way later. 在性能方面不是很好,但是它会为您腾出一些时间来找出以后的正确方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM