Page 1 of 1
URL rewriting stopping .ashx errors? Please respond!
Posted: Fri Mar 06, 2009 6:27 am
by moopa
I can type mysite.com/anything.ashx and i do not get a 404.
I am trying to debug my handler and even forcing an exception shows no error in the browser.
Is it possible to turn rewriting off? Would there be something else that would be doing this?
All the other sites on the server will show exceptions in the browser and 404 on ficticious .ashx files.
Thanks
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Fri Mar 06, 2009 6:50 am
by moopa
I have turned off rewriting and i have the same issue.
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Wed Mar 11, 2009 10:30 am
by jmestep
I don't know the answer, but I think it is pretty complicated in .net and might have to do with http handlers. You might search Google on that subject.
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Wed Mar 11, 2009 11:29 am
by Logan Rhodehamel
Perhaps are custom errors defined in the web.config?
Code: Select all
<system.web>
<customErrors mode="On" defaultRedirect="~/Errors/GeneralError.aspx">
<error statusCode="404" redirect="~/Errors/PageNotFound.aspx" />
</customErrors>
This can mask the expected behavior.
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Wed Mar 11, 2009 4:58 pm
by moopa
Thanks for the response.
I must stress that aspx shows errors fine.
I have turned off able rewriting and nothing like ClearError() in the global.asax.
Can someone else try going to anything.ashx on their dev server and seeing if u get the same?
Thanks
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Wed Mar 11, 2009 5:16 pm
by nickc
I get default.aspx?aspxerrorpath=/anything.ashx (what I expected).
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Thu Mar 12, 2009 6:10 am
by jmestep
On my test site, I don't have customErrors set to On, so I don't get the redirect, but I do get it with a site where customErrors is set to On.
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Thu Mar 12, 2009 10:56 am
by Logan Rhodehamel
moopa wrote:Can someone else try going to anything.ashx on their dev server and seeing if u get the same?
On my install I have URL rewriting on and custom errors off. I access anything.ashx and it returns HTTP 404.
To troubleshoot, you might want to do something like rename your web.config, then see if you can get 404. If so, then create a new web.config file and start adding pieces back in until you determine where the problem is originating. If renaming the web.config does not fix the problem, then it would seem to indicate it's something with the webserver setup.
Re: URL rewriting stopping .ashx errors? Please respond!
Posted: Mon Mar 16, 2009 8:16 am
by moopa
Hi all.
Thanks for the response.
I have setup a new local dev version of the site and i also get the correct behaviour (on an XP box).
Strangely this issue is only affecting our Win2003 64bit dev server. I have no idea why but at least i can locally debug now
Best Regards