Clarke76
Clarke76

Reputation: 774

Default.aspx page won't load on IIS 6

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

Upvotes: 1

Views: 4309

Answers (1)

Chris Shain
Chris Shain

Reputation: 51329

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.

Upvotes: 3

Related Questions