Question

I have the httphandler on shared webhosting. It works.

The httphandler webapp (virtual) dir of this httphandler does not have web.config and the whole shared user's website has web.config with only one uncommented statement:

<compilation defaultLanguage="c#" debug="false"/>

Now, I change it to:

<system.web>
    <urlMappings enabled="true">
    <add url="~/CheckLoad" mappedUrl="~/BackupLicense.ashx?key=CheckLoad"/>
    <compilation defaultLanguage="c#" debug="false">
      </compilation>
</system.web>

This(*) works locally (on VS2008 internal webserver) but not on shared hosting.

What do I miss? (*) means calling [1a], which works only locally but on shared hosting it gives "The page not found" "HTTP Error 404"

[1a] Calling as: http://www.MySharedSite.com/CheckLoad (additionally to always and evertwhere working [1b] http://www.MySharedSite.com/BackupLicense.ashx?key=CheckLoad

Was it helpful?

Solution

There are some subtle differences in how URL's are handled on the built-in webserver and on IIS6 and 7. You need to know the version of IIS running on your shared host.

Specifically, IIS6 does not support URL's without the extension being mapped to aspnet_isapi.dll - and since you are not using an extension for the URL, this could be the case.

If your host is using IIS7 with integrated pipeline mode, you propably need to configure the system.webServer section with your url mapping, instead of system.web. (Also, see this question for an explanation of the difference).

Edit I see in the comments your webhost is using IIS6. Then you need to ask your webhost to allow the /Checkload URL to be processed by ASP .NET. Another easy way to make it work would be to just use .ashx on the end of the url; since the .ashx extension is already mapped to ASP .NET in the standard configuration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top