Serving pages which do not exist

  • Thread starter Peter Morris [Droopy eyes software]
  • Start date
P

Peter Morris [Droopy eyes software]

Hi all

Instead of a url like so

http://www.howtodothings.com/viewarticle.aspx?id=1

I'd like to do this

http://www.howtodothings.com/articles/computers/dotnet/aspdotnet/001.html


I don't want to have to create all of the subfolders + html files etc. I
vaguely remember reading somewhere that it is possible to do this. Where
IIS receives a request for a specific page, but the request is actually
internally mapped to something else (the first url I showed).

Could someone tell me how this is done please, or maybe let me have a URL
explaining it?

Thanks


--
Pete
====
ECO Modeler, Audio compression components, DIB graphics controls,
FastStrings
http://www.droopyeyes.com

Read or write articles on just about anything
http://www.HowToDoThings.com

My blog
http://blogs.slcdug.org/petermorris/
 
P

Peter Morris [Droopy eyes software]

By the way, this also needs to be done in code, not statically in a config
file or something.
 
D

Dave Fancher

The February 2005 issue of MSDN Magazine has an article that touches on
this. An older issue covers the same subject as well.

In the Feb 2005 issue, they use an HttpModule but this can also be
implemented just as easily in the Application_BeginRequest event in
global.asax which is what i typically use. [Figure 3 includes a code
listing for rewriting a URL]

http://msdn.microsoft.com/msdnmag/issues/05/02/InsideMSDN/default.aspx
 
T

Teemu Keiski

Hello,

map *.* extensions to ASP.NET (aspnet_isapi.dll) so that all requests not
mapped to elsewhere are processed by it (note that this can cause
performance burden on the server), and then at ASP.NET side you can map a
HTTP handler to this * extension whichs again solves what action should be
done based on query string.

Note that you can also do some tricks onfiguring IIS such that when ever a
page requested is not found it redirects to a custom page (your page) with
certain parameters and you can again in your logic decide what to do based
on the parameters.
 

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

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top