DotNetNuke 中的友好 URL - 故障排除
在 DNN 中,我使用主机设置 ->友好的 URL 设置尝试使页面 URL 对 SEO 友好。但我不断收到错误,我不知道为什么。
当前 URL 格式:
http://localhost/dnn/Admin/MyPage.aspx?title=news-article-name-written-here
所需 URL 格式:
http://localhost/dnn/Admin/MyPage/news-article-name-written-here
“友好 URL 设置”规则:
MATCH: .*/MyPage/(.*) REPLACE WITH: ~/Admin/MyPage.aspx?title=$1
错误:
应用程序“DEFAULT WEB SITE/DNN”中的服务器错误
Internet 信息服务 7.5 错误摘要 HTTP 错误 404.0 - 否 找到了
您要查找的资源已被删除,并有其名称 已更改,或暂时不可用。
附带说明一下,我对购买任何专门的 DNN 模块来执行此操作(或使用免费的 iFinity 模块)不感兴趣。有什么想法我可能做错了什么吗?或者,如果由于某种原因这是不可能的,有人可以解释为什么吗?
预先非常感谢!
In DNN, I'm using Host Settings -> Friendly Url Settings to try and make a page url SEO-friendly. But I keep getting an error and I don't know why.
Current URL format:
http://localhost/dnn/Admin/MyPage.aspx?title=news-article-name-written-here
Desired URL format:
http://localhost/dnn/Admin/MyPage/news-article-name-written-here
"Friendly Url Settings" rule:
MATCH: .*/MyPage/(.*) REPLACE WITH: ~/Admin/MyPage.aspx?title=$1
Error:
Server Error in Application "DEFAULT WEB SITE/DNN"
Internet Information Services 7.5 Error Summary HTTP Error 404.0 - Not
FoundThe resource you are looking for has been removed, had its name
changed, or is temporarily unavailable.
As a side note, I'm not interested in buying any specialized DNN modules to do this (or using the free iFinity one). Any ideas at all what I might be doing wrong? Or, if this is impossible for some reason, could anybody please explain why?
Thanks very much in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,问题解决了 - 事实证明,您无法使用默认的 DNN Url Rewriter 删除文件扩展名。所以这就是我所做的:
(http://www.iis.net/download/urlrewrite)
标记中:希望对其他人有帮助!
Alright, solved it - as it turns out, you can't drop file extensions with the default DNN Url Rewriter. So here's what I did instead:
(http://www.iis.net/download/urlrewrite)
<system.webServer>
tag of the dnn site's web.config:<rewrite><rules><rule name="UrlRewriteService" stopProcessing="true"><match url="^.*/MyPage/(.*)$"/><action type="Rewrite" url="Admin/MyPage.aspx?title={R:1}" /></rule></rules></rewrite>
Hope that helps somebody else!