1

我有一个 DotNetNuke 7 网站,并且启用了如下自定义错误:

    <customErrors mode="On" defaultRedirect="Error.aspx">
        <error statusCode="404" redirect="FileNotFound.aspx" />
    </customErrors>

我还想为扩展较少的 URL 添加此类错误,但是当我尝试添加通配符映射时,它会在http://mysite.com等上用 404 破坏站点

<add name="WILDCARDMAPPING" path="*" verb="*" type="" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" allowPathInfo="false" preCondition="integratedMode,bitness64" />

我如何设置处理程序..

<handlers accessPolicy="Read, Execute, Script">
        <remove name="WebServiceHandlerFactory-Integrated" />
        <add name="LogoffHandler*" path="Logoff.aspx" verb="*" type="DotNetNuke.Services.Authentication.LogOffHandler, DotNetNuke" preCondition="integratedMode" />
        <add name="RSSHandler" path="RSS.aspx" verb="*" type="DotNetNuke.Services.Syndication.RssHandler, DotNetNuke" preCondition="integratedMode" />
        <add name="LinkClickHandler" path="LinkClick.aspx" verb="*" type="DotNetNuke.Services.FileSystem.FileServerHandler, DotNetNuke" preCondition="integratedMode" />
        <add name="CaptchaHandler" path="*.captcha.aspx" verb="*" type="DotNetNuke.UI.WebControls.CaptchaHandler, DotNetNuke" preCondition="integratedMode" />
        <add name="UserProfilePageHandler" path="User.aspx" verb="*" type="DotNetNuke.Services.UserProfile.UserProfilePageHandler, DotNetNuke" preCondition="integratedMode" />
        <add name="RadProgressHandler" verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.Upload.RadUploadProgressHandler, Telerik.Web.UI" preCondition="integratedMode" />
        <add name="UserProfilePicHandler" path="ProfilePic.ashx" verb="*" type="DotNetNuke.Services.UserProfile.UserProfilePicHandler, DotNetNuke" preCondition="integratedMode" />
        <remove name="ExtensionlessUrl-Integrated-4.0" />
        <add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
        <add name="SitemapHandler" path="Sitemap.aspx" verb="*" type="DotNetNuke.Services.Sitemap.SitemapHandler, DotNetNuke" preCondition="integratedMode" />
        <add name="ClientDependencyHandler" verb="*" path="DependencyHandler.axd" type="ClientDependency.Core.CompositeFiles.CompositeDependencyHandler, ClientDependency.Core" preCondition="integratedMode" />
        <add name="Telerik.Web.UI.WebResource" verb="*" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode" />
        <add name="Telerik.Web.UI.ChartHttpHandler" verb="*" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
        <add name="HtmTemplateFileHandler" verb="*" path="*.htmtemplate" type="DotNetNuke.Providers.RadEditorProvider.HtmTemplateFileHandler, DotNetNuke.RadEditorProvider" preCondition="integratedMode" />
        <add name="WILDCARDMAPPING" path="*" verb="*" type="" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" allowPathInfo="false" preCondition="integratedMode,bitness64" />
    </handlers>

我已经尝试将我添加到顶部、中间的处理程序电影WILDCARDMAPPING,但它不起作用。

当有一个页面已添加到 CMS(如 /Home)但显示 /somepage 的正常 404 错误消息时,DNN 已经提供了对无扩展 URL 的支持。

4

3 回答 3

0

这有效:

  <system.webServer>
    <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" path="/FileNotFound.aspx" responseMode="ExecuteURL" />
    </httpErrors>
  </system.webServer>
于 2013-09-19T09:40:50.503 回答
0

DNN 7.1 包括新的“高级 URL 提供程序”(基于 iFinity 的 URL Master 扩展),其中包括对 404 页面和无扩展 URL 的内置支持。在新的 DNN 7.1 站点中有一个名为“404 错误页面”的页面(您必须在升级的站点中手动创建它,请参阅http://www.dnnsoftware.com/answers/cid/350985上接受的答案),对于未找到的页面(无论是否有扩展名),都将返回。

有关的:

于 2013-09-19T14:49:29.640 回答
0

只需在每个目录中添加一个index.html显示您希望为该案例显示的内容 - 默认情况下,打开http://SomeUrl/some/path/总是打开/尝试打开http://SomeUrl/some/path/index.html

于 2013-07-10T08:16:56.473 回答