Adding independent aspx/asmx pages into DotNetNuke

与世无争的帅哥 提交于 2020-01-04 14:31:21

问题


Howdy, I just installed dotnetnuke 5.06 on my server, say, the path is mydomain.com/dnn

I have a library independent of dotnetnuke that I have to run and it contains web services and various other httphandlers so I haven't tried to integrate it into DNN just yet. the library is located under mydomain.com/dnn/lib

The library worked fine on my old server running 5.04 and everything worked fine, but for some reason my new installation with 5.06 (windows 2008, sql server, iis 7.5) returns 404 when i try to access a page under mydomain/dnn/lib/, regardless of whether it's aspx, asmx...however images seem to work just fine, everything else either returns 404 or redirect to default.aspx in DotNetNuke. This has never happened before with my old site.

does anyone know what I'm missing here? any suggestion is be greatly appreciated.


回答1:


There's was an issue introduced in DNN 5.5 that blocks those files when they're outside of the DesktopModules folder. DNN 5.6.1 fixed that to some degree (I'm fairly sure that aspx works now), but not completely. Looking at the linked issue, it may help/fix to turn off automatic portal alias mapping in your Site Settings.




回答2:


Actually, the issue was fixed only in DNN 5.6.2, which is currently in beta. Version 5.6.1 still had this issue. There's a workaround that works in every situation: add the absolute url to your PortalAlias table. You'll have to do this by hand, because the Portals-tab doesn't allow aliases that root at the same level as an existing alias.

Another solution, if you can't wait for the new DNN version, includes adding the following code to the RequestFilterModule.vb and UrlRewriteModule.vb, which restores the existing behavior. This is not the fix that's applied to DNN 5.6.2, because programmers believe it is too much of a performance impact to check for file existence on every visit (which I consider odd, as several files are touched on every visit anyway, the main DNN cache uses file-based caching and in general, database access is slower than file access):

'Add this to the RequestFilterModule.vb (line #59)'
'and to UrlRewriteModule.vb (line #325)'
If File.Exists(app.Server.MapPath(Request.Url.LocalPath)) And Not _ 
   Request.Url.LocalPath.ToLower.EndsWith(glbDefaultPage.ToLower) Then

     'exit early when path is an existing path'
     Exit Sub
End If

Obviously, if you apply this fix, you have to be careful with the next update of DNN.



来源:https://stackoverflow.com/questions/4926958/adding-independent-aspx-asmx-pages-into-dotnetnuke

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!