Default.aspx 页面不会在 IIS 6 上加载

发布于 2025-01-06 06:46:23 字数 806 浏览 0 评论 0原文

使用 .net 4 在主网站上运行 IIS 6。我有许多子网站,主要运行 .net 4,浏览它们时 default.aspx 自动加载,没有问题。然而,其中一个网站正在运行 .net 3.5,当浏览到开放式 url 时,default.aspx 不会自行加载: http://127.0.0.1/TestApp 但是,如果我直接浏览到该文件,它工作正常:http://127.0.0.1/TestApp/Default.aspx

查看 .net 3.5 Web 应用程序下的文档,它确实将 Default.aspx 显示为“启用的默认内容页面”。如果我将应用程序切换到 .net 4.0,default.aspx 页面会自动加载。但我无法保留此设置,因为它是一个编译的网络应用程序,并且在某些页面上出现错误,并且无权更新代码。

有谁见过这个问题并知道如何解决?任何帮助/想法都会很棒!

谢谢!

编辑

错误页面 找不到资源。 描述:HTTP 404。您正在查找的资源(或其依赖项之一)可能已被删除、名称已更改或暂时不可用。请检查以下 URL 并确保拼写正确。

请求的 URL:/licensure/eurl.axd/ce90d150037c2545966c2948cd3e2e7e/


版本信息:Microsoft .NET Framework 版本:2.0.50727.3053; ASP.NET版本:2.0.50727.3053

Running IIS 6 with a main website using .net 4. I have many sub websites under that mostly running .net 4 and when browsing to them default.aspx auto loads without issue. One of the websites, however, is running .net 3.5 and default.aspx won't load by itself when browsing to an open ended url: http://127.0.0.1/TestApp however if I browse directly to the file it works fine: http://127.0.0.1/TestApp/Default.aspx.

Looking at the Documents under the .net 3.5 web application it does show Default.aspx as an "enabled default content page." If I switch the app to .net 4.0 the default.aspx page does load automatically. I cannot keep this setting though because it is a compiled web app and errors out on some pages and don't have the access to update the code.

Has anyone seen this issue and know how to resolve? Any help/ideas would be great!

Thanks!

EDIT

Error Page
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /licensure/eurl.axd/ce90d150037c2545966c2948cd3e2e7e/


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兮子 2025-01-13 06:46:23

您可能想查看此网站:http: //www.vanadiumtech.com/OurBlog/post/2011/08/12/Cause-of-eurlaxd.aspx

看来这与.NET 4 的无扩展名 URL。

从上面的链接页面:

推荐解决方案

如果禁用 v4.0 ASP.NET Extensionless
IIS6 上的 URL 功能,通过设置 DWORD
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\EnableExtensionlessUrls
= 0 并重新启动 IIS,然后 ASP.NET 功能将被禁用,除非恶意客户端,否则您将不会在 URL 中看到“/eurl.axd/GUID”
向您的服务器发出此类请求。

我们的修复

在我们的案例中,解决方案来自 HeliconTech,他是
我们的 IIS 重写模块的提供商

http://www.helicontech.com/forum/15029-ASPNET_40_MVC_and_ISAPI_Rewrite_3.html

我们发现 eurl.axd 在我们执行操作时被附加
重定向。 eurl.axd是在重定向之前添加的,所以isapi
包含它,就好像它是 url 的正确部分一样。

例如,我们将 www 重定向到非 www。为了忽略
eurl.axd 部分,我必须将规则更改为:

RewriteCond %{HTTPS}(打开)? RewriteCond %{HTTP:Host} ^www.(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)? RewriteRule ^(.)(eurl.axd/.)$
http(?%1s)://%2/$1 [R=301,L]

如果你想走另一条路,将非 www 重定向到 www,这是一个
轻松更改:

RewriteCond %{HTTPS}(打开)? RewriteCond %{HTTP:Host} ^(?!www.)(.+)$
[NC] RewriteCond %{REQUEST_URI} (.+)?重写规则
^(.)(eurl.axd/.)$ http(?%1s)://www.%2/$1 [R=301,L]

希望这会有所帮助,花了一段时间才确定下来,但解决方案
在我们共享的环境中发挥作用,无需
通过禁用无扩展功能来影响所有客户或
将所有内容迁移到 IIS7。

You might want to see this site: http://www.vanadiumtech.com/OurBlog/post/2011/08/12/Cause-of-eurlaxd.aspx

Appears that this has to do with .NET 4's extensionless URLs.

From the above linked page page:

Recommended Solutions

If you disable the v4.0 ASP.NET extensionless
URL feature on IIS6 by setting a DWORD at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\4.0.30319.0\EnableExtensionlessUrls
= 0 and restart IIS, then the ASP.NET feature will be disabled and you will not see "/eurl.axd/GUID" in your URLs unless a malicous client
issues such requests to your server.

Our Fix

In our case the solution came from HeliconTech who is the
provider of our IIS Rewrite Module

http://www.helicontech.com/forum/15029-ASPNET_40_MVC_and_ISAPI_Rewrite_3.html

We found that the eurl.axd was being appended when we were doing a
redirect. The eurl.axd was added before the redirect, so isapi
includes it as if it is a correct part of the url.

For example, we're redirecting www to non-www. In order to ignore the
eurl.axd part, I had to change the rule to:

RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^www.(.+)$ [NC]
RewriteCond %{REQUEST_URI} (.+)? RewriteRule ^(.)(eurl.axd/.)$
http(?%1s)://%2/$1 [R=301,L]

If you want to go the other way and redirect non-www to www, it's an
easy change:

RewriteCond %{HTTPS} (on)? RewriteCond %{HTTP:Host} ^(?!www.)(.+)$
[NC] RewriteCond %{REQUEST_URI} (.+)? RewriteRule
^(.)(eurl.axd/.)$ http(?%1s)://www.%2/$1 [R=301,L]

Hope this helps, it took a while to nail it down, but the solution
worked like a charm in our shared environments without having to
impact all customers by disabling the extension less feature or
migrating everything to IIS7.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文