Orchard CMS - 配置基本 URL
我使用 localhost/frankgiotto 的基本 URL 在我的开发计算机上安装了最新版本的 Orchard。然后我将网站移至 www.frankgiotto.com 并在设置中更新了我的基本 URL。
网站运行完美。我喜欢它的一切,但有一件事是每个页面上的所有链接都映射到 www.frankgiotto.com/frankgiotto/etc 而我只想 www.frankgiotto.com/etc
这一刻让我发疯。帮助任何人!?
附:是的,我绝对确定 Base Url 设置为 www.frankgiotto.com 有趣的是,www.frankgiotto.com/Blog 和 www.frankgiotto.com/frankgiotto/Blog 都可以工作并将我带到同一个地方。与网站上的其他所有内容相同。
I installed the latest version of Orchard on my dev machine using a base url of localhost/frankgiotto. Then I moved the site to www.frankgiotto.com and updated my Base URL in the settings.
Site works perfectly. I love everything about it but the one thing is that all the links on every page are mapping to www.frankgiotto.com/frankgiotto/etc and I want simply www.frankgiotto.com/etc
This is driving me insane at the moment.. help anyone!?
p.s.. Yes, I made absolutely sure that Base Url is set to www.frankgiotto.com
Interestingly enough, www.frankgiotto.com/Blog and www.frankgiotto.com/frankgiotto/Blog both work and take me to the same place. Its the same with everything else on the site.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这有点断章取义,但要使 orchard url 在本地正常工作,只需执行以下操作,
的将使应用程序在没有“/”的情况下运行,因此出现上述问题的可能性较小
This is little out of context, but to make the orchard urls work without any issue on local just do the following
that will make the app run without "/", hence less chance for the above issue
是的,不幸的是,这是一个已知问题。这是因为目前链接和图像地址仅以纯 HTML 形式存储在数据库中。理想情况下,它们将被存储为逻辑引用,并且可以基于生产服务器重新建立基础。现在这个功能还不存在,所以我们鼓励人们在他们的开发盒上使用端口而不是虚拟目录,如果他们要部署在域的根目录下。这样相对网址就可以工作了。在您的情况下,恐怕您必须手动重新调整现有链接并更改您的开发盒配置。
Yes, that is a known issue unfortunately. This is because for now links and image addresses are just stored as plain HTML in the database. Ideally, they would be stored as logical references instead and could be rebased on the production server. This feature does not exist today so what we encourage people to do is to use a port rather than a virtual directory on their dev box if they are going to deploy at the root of a domain. This way relative urls just work. In your case I'm afraid you'll have to manually rebase the existing links and change your dev box configuration.