views:

101

answers:

1

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] htt p:// www. MySharedSite. com/ BackupLicense.ashx ?key=CheckLoad

+1  A: 

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.

driis
DrIIS, thanks,useful link but I seems do not have the right to vote.Especially I likedhttp://arcware.net/use-a-single-web-config-for-iis6-and-iis7/I studied responses from shared webhosting site and they tell that uses IIS6.So, the question is the same and I came out with a few more.What are the modes of internal webserver used by VS2008, VS2005, VS2003?Note that locally I really do not use virtual directories and IIS.
vgv8
Once agin, just trying to recover formatting of my previous post:DrIIS, thanks, useful link but I seems do not have the right to vote. Especially I liked arcware.net/use-a-single-web-config-for-iis6-and-… I studied responses from shared webhosting site and they tell that it uses IIS6. So, the question is the same and I came out with a few more: What are the modes of internal webserver used by VS2008, VS2005, VS2003? Note that locally I really do not use virtual directories and IIS.
vgv8
Once agin, just trying to recover formatting of my previous post (now in Opera): DrIIS, thanks, useful link but I seems do not have the right to vote. Especially I liked arcware.net/use-a-single-web-config-for-iis6-and-… I studied responses from shared webhosting site and they tell that it uses IIS6. So, the question is the same and I came out with a few more: What are the modes of internal webserver used by VS2008, VS2005, VS2003? Note that locally I really do not use virtual directories and IIS
vgv8
Reposting, could not managed to preserve formatting neither from IE6 nor Opera:------------------------DrIIS, thanks, useful links. Especially I liked arcware.net/use-a-single-web-config-for-iis6-and-… Though, my wehoster webserver is IIS6. So, the question remains the same and I came out with a few more: What are the modes of internal webserver used by VS2008, VS2005, VS2003? Note that locally I really do not use virtual directories and IIS.
vgv8
My webhosting is with IIS 6
vgv8