DotNetNuke中的友好网址-故障排除 [英] Friendly Urls in DotNetNuke - Troubleshooting
问题描述
在DNN中,我使用主机设置"->友好的网址设置"来尝试使页面网址对SEO友好.但是我不断出错,不知道为什么.
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.
当前网址格式:
http://localhost/dnn/Admin/MyPage.aspx?title=news-article-name-written-here
所需的URL格式:
http://localhost/dnn/Admin/MyPage/news-article-name-written-here
友好的网址设置"规则:
"Friendly Url Settings" rule:
MATCH: .*/MyPage/(.*) REPLACE WITH: ~/Admin/MyPage.aspx?title=$1
错误:
应用程序默认Web站点/DNN"中的服务器错误
Server Error in Application "DEFAULT WEB SITE/DNN"
Internet信息服务7.5错误摘要HTTP错误404.0-否 找到
Internet Information Services 7.5 Error Summary HTTP Error 404.0 - Not Found
您要查找的资源已被删除,并具有其名称 更改,或暂时不可用.
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
请注意,我对购买任何专门的DNN模块(或使用免费的iFinity模块)不感兴趣.有什么想法我可能做错了吗?或者,如果由于某种原因这是不可能的,请问任何人可以解释原因吗?
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?
非常感谢!
推荐答案
好了,解决了-事实证明,您无法使用默认的DNN Url重写器删除文件扩展名.所以这是我做的:
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:
- 在我的IIS上安装了urlrewrite扩展名 (http://www.iis.net/download/urlrewrite)
- 在dnn站点的web.config的
<system.webServer>
标记中添加了以下代码段:
- Installed the urlrewrite extension on my IIS (http://www.iis.net/download/urlrewrite)
- Added the following code snippet to the
<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>
希望对别人有帮助!
这篇关于DotNetNuke中的友好网址-故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!