application mapping in iis

I

Ian Turner

Hi,

In an attempt to get every request for a particular virtual directory to go
through ASP.NET I've been trying to add a wildcard application mapping. The
scenario is that any url for that VD, whether it resolves to an actual file
or not, can be intercepted by an HttpModule and ultimately redirected (using
RewritePath) to a resource of my choosing.

I was hoping that just adding the wildcard mapping to the IIS VD would work.
But it doesn't seem to. In fact, now I can't get ANY urls to work - even if
they are to real files. Everything just gives me a 404. This includes aspx,
html, jpg etc...

The mapping I added was for the aspnet_isapi.dll, mapped to the extension .*
and limited to GET,HEAD,POST,DEBUG. I also tried it with all verbs but that
didn't work either. It was added to all the existing mappings the asp.net
registers.

I'm using windows xp pro.

Can anyone offer any guidance?

Cheers
Ian
 
D

Dmitry Andreev

All is correct.

Try move your HttpModule up in order of already loaded modules (auth module
generates 404 if resource not found)
 
I

Ian Turner

Hi Dimitry,

Thanks for your reply (and the one to my other thread).

That will not make any difference in this case as the problem occurs whether
I register an HttpModule or not. It seems to me that the wildcard mapping
just doesn't work for whatever reason. I'm going to try replicating this on
another box to see whether there is a local problem with my development
machine.

Cheers
Ian Turner MCSD.NET

P.S. Congrats on the MCSD.NET. Did you get the Early Achiever as well? I
took the last exam on the 29th Sept so got it by one day!
 
D

Dmitry Andreev

But. Try unregister auth module (via web.config)

P.S MCSD.NET march 8.

P.P.S (another post) if you want, I send you small example of url rewriting
with regexp matching (tomorrow)
 
I

Ian Turner

Hi,

I think I've found the problem... and it is a bit obscure.

The Virtual Directory that I was using had a full-stop in the name. We have
a convention at work where all virtual directories and websites within IIS
are given the name of the assembly that contains the website presentation
logic (code-behind etc.) - usually something like
Net.Syzygy.ProjectName.Website.

It seems that the wildcard extension doesn't like this convention... The
actual 404 error is generated by IIS not ASP.NET (I don't think I mentioned
that in my original post - sorry).

If you have a moment, you could try and reproduce the problem. Create two
virtual directories both pointing at the same physical location - something
containing an html page or image etc. that you can browse to. Give one VD a
name without a '.' in the name, the other with. You should be able to
navigate to whatever is in the VD ok. Now, add the wildcard mapping to each
VD. When you navigate to the VD with the '.' in the name, you should get a
404 from IIS. The other one will still work OK.

As I said, this is on Windows XP Pro so might only occur on that platform...

Cheers
Ian

P.S. yes, if you could send the sample code that would be great! if you want
to mail me directly, can you use (e-mail address removed) - which is my work
mail. Cheers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top