如何在虚拟路径上创建 SharePoint 2007 Web 应用程序来解决 url 重写规则?
无论如何,我可以在不在根目录上安装 SharePoint Web 应用程序,但我需要在虚拟路径上安装它?我遇到的情况是,我的客户正在使用 ISA 服务器的 url 重写工具,如下所示: 他有一个主要网址http://publicsite/ 我们在一个名为 http://internal/sites/sitecollection 的网站上实现了内部共享 当我们打开 http://publicsite/sites/sitecollection 时,它将打开 http://internal/sites/sitecollection http://publicsite/ 与 http://internal 位于不同的服务器上。 现在,我对共享点站点渲染的 html 标记中的嵌入资源有一个问题,实际上
<script src="/ScriptResource.axd?d=MZkmbKEwKTBSRdxFCFncmF72UDKBF9tO54OpDYX6Df4DBmB7HSDbA8CAqY5mCBAK2TAU34oVF24xOS5EJEafjb6Zcvwnmou5zv3RqxNzcSKM1XXzvQP1JpAzOAaH9PUPRTPUjZfdMBnoJPmBfgNZ-BFEntGwjcL7UiqfpH8R9TE1&t=ffffffffed1cce36" type="text/javascript"></script>
它是从根目录打开的,并且基于客户重写规则的根目录是另一台服务器,因此状态为 404 的资源响应 AFAIN 因为 sharepoint Web 应用程序位于根目录上,所以我无法更改它呈现 url 的方式。
有什么办法可以解决这个问题吗? 我开始考虑一些 javascript 函数来更改以 /ScriptResource.axd
开头的所有脚本的 url,并将其更改为 /sites/sitecollection/ScriptResource.axd
但它无法重新加载 javascript 我不知道为什么!! 第二个解决方案是在虚拟路径上创建 Web 应用程序,我不知道这是否可行,所以有人可以帮助我吗?
提前致谢。 问候
I there anyway that I can install a SharePoint web application not on the root I need it on a virtual path? I have a situation that my customer is using somehow a url rewriting tool using ISA server like the following:
He have a main url let say http://publicsite/
we have sharepoint implemented internal on a site called http://internal/sites/sitecollection
when we open http://publicsite/sites/sitecollection it will open http://internal/sites/sitecollection
http://publicsite/ is on a different server than http://internal.
Right now I have an issue with the embedded resources in the rendered html markup for the sharepoint site like
<script src="/ScriptResource.axd?d=MZkmbKEwKTBSRdxFCFncmF72UDKBF9tO54OpDYX6Df4DBmB7HSDbA8CAqY5mCBAK2TAU34oVF24xOS5EJEafjb6Zcvwnmou5zv3RqxNzcSKM1XXzvQP1JpAzOAaH9PUPRTPUjZfdMBnoJPmBfgNZ-BFEntGwjcL7UiqfpH8R9TE1&t=ffffffffed1cce36" type="text/javascript"></script>
effectually it opens from the root and root based on the customer rewrite rule is another server so the resource response with status 404
And AFAIN since the sharepoint web application on the root so I can't change the way it renders the url.
Is there any way to solve this?
I started to think about some javascript function to change the url of all scripts with starts with /ScriptResource.axd
and change it to /sites/sitecollection/ScriptResource.axd
but It faild to reload the javascript I don't know why!!
The 2nd solution Is to create the web application on a virtual path and I don't know if this possible or not, so can anybody help me?
Thanks in advance.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的第一个建议是为共享点创建一个不同的公共 URL。如果你这样做,你就会避免很多伤害。
但如果您确实需要继续,您可以尝试实现一个 HttpModule 来替换错误的引用。如果您所做的不仅仅是查看某些内容,那么您将必须对此进行一些测试。 (协作、办公同步等)
https://sharepoint.stackexchange.com /questions/5956/rich-text-editor-error-messages/8364#8364
My first suggestion would be to create a different public url for sharepoint. You are going to save yourself a lot of hurt if you do.
But if you really need to go forward, you could try to implementing a HttpModule that replaces the bad references. And you are going to have to test this a fare bit it you are doing anything more than just viewing some content. (collaboration, office sync etc)
https://sharepoint.stackexchange.com/questions/5956/rich-text-editor-error-messages/8364#8364
您可能需要更改页面上的路径。更改 ISA 服务器的配置仍然会带来根目录与 SharePoint 站点位于不同服务器上的问题。
如果 JavaScript 方法不起作用,您可以尝试使用建议的“自适应控制行为”作为此问题<的答案/a>,在重写所有脚本标记的地方,您还需要重写样式和图像标记,因为有些标记将引用 /_layouts
虽然这是一种严厉的方法,但控制适配器与 SharePoint 配合得很好。
You will probably need to change the path on the page. Changing the configuration of the ISA server will still leave you with the problem that the root is on a different server to the SharePoint site.
If the JavaScript approach did not work you could try use the "adaptive control behavior" as suggested as the answer for this Question, Where you rewrite all the Script tags, you will also need to rewrite the Style and Image tags as some will refer to /_layouts
A heavy handed approach though but Control adapters work well with SharePoint.
我认为您可以将内部服务器上的网络应用程序扩展到附加网址 http://publicsite/。现在,您将依赖智能 IP 路由,因此如果 URL 为 http://publicsite/sites/sitecollection,它就会到你的内网服务器,否则到公共服务器。听起来好像您的 ISA 服务器已经这样做了。我认为这将使所有相关链接正确。
I am thinking you could extend the web app on the internal server to the additional url http://publicsite/. Now you will rely on intelligent IP routing so that if the URL is http://publicsite/sites/sitecollection it goes to your intranet server, otherwise it goes to the public server. It sounds as though your ISA server already does this. I think that would make all the relative links correct.