如何更改 DNN 网站的域名
我需要更改 DNN 5 网站的域名。客户不希望旧域不再可见,因此添加门户别名似乎不是答案。该网站有数百个(如果不是数千个)文件和图像链接,因此我需要确保我使用的任何解决方案都不会破坏这一点。
任何建议将不胜感激。
I need to change a domain name for a DNN 5 website. The customer does not want the old domain to be visible any longer so adding a portal alias does not seem to be the answer. The site has hundreds, if not thousands, of links to files and images so I need to make sure what ever solution I use does not break this.
Any advice would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加新的门户别名,并结合在 Web 服务器上进行必要的更改以识别新域,将会起作用。 DNN 不允许您通过 Web UI 编辑主门户别名,但您也可以简单地使用新域名更新数据库中的记录(即 PortalAlias 表)。
关于文件和图像的链接,如果将它们作为相对链接完成,那么它们将继续正常工作。如果链接和图像 URL 是使用完整路径创建的,则必须更新它们。这也可以通过一些有针对性的 SQL 脚本来实现。
Adding the new portal alias, in combination with making the requisite changes on the web server to recognize the new domain, will work. DNN does not allow you to edit the primary portal alias through the web UI, but you could also simply update that record in the database with the new domain name (it's the PortalAlias table).
Regarding the links to files and images, if they were done as relative links then they will continue to work fine. If the links and image urls were created with the full path, then they will have to be updated. That could be achieved with some targeted sql scripts as well.
自从提出这个问题以来已经快有 10 年了,但我最近遇到了这个问题,所以我将记录一下我是如何解决它的。我使用的是 DNN 版本 9.1.1
Site settings >网站行为>站点别名
。添加别名
,然后输入别名,例如mynewurl.com设置主要
按钮,然后保存
。站点别名映射模式
设置为重定向
。这将导致所有其他 url/站点别名重定向到新 url。web.config
并更改authentication
节点下的域从 .myoldurl.com 到.mynewurl.com。如果您错过这一步,您将无法使用新网址登录。请参阅下面的
It's almost 10 yrs since this question was asked but I ran into this issue recently, so I'll document how I solved it. I'm using DNN version 9.1.1
Site settings > Site Behavior > Site Aliases
.Add Alias
, and enter alias name such as mynewurl.comSet Primary
button and thenSave
.Site Alias Mapping Mode
toRedirect
. This will cause all other urls/site aliases to be redirected to the new url.web.config
and changethe domain under
authentication
node from .myoldurl.com to.mynewurl.com. If you miss this step, you will not be able to login with the new url. See below
<authentication mode="Forms"> <forms name=".DOTNETNUKE" protection="All" timeout="60" cookieless="UseCookies" enableCrossAppRedirects="true" domain=".mynewurl.com" /> </authentication>