Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Url mapping

Status
Not open for further replies.

RicksAtWork

Programmer
Nov 1, 2005
120
GB
In IIS you can map extensions i.e. aspx to a iisapi.

I also know you can blanket map all requests to specific iisapi for example the ASP.NET wp.

I want urls such as:


to map to asp.net, however I dont want images or css to be pointed at ASP.NET (otherwise I will have to write a specific httphandler for each extension).

Under IIS can you specify all requests to point at ASP.NET with the exception of a few extensions i.e. .gif .css . jpg

??
 
Is it possible to map ALL extensions to the asp.net runtime? I've read on several MSDN articles that it is, however they didnt specify how!
 
of course it is, the same way you would add one extension. But there are extremely good reasons why you definitely shouldn't.
Unless of course you are happy with the increased risk of having your server compromised.

Not to mention the increased overhead of processing every file.

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
So I will still need a page in that folder?

I was under the impression that the path didnt have to exist and IIS would still map it to ASP.NET??
 
You are NOT talking about mapping extensions to ASP.NET then

That is URL rewriting you are asking about

In that case you need to be reading in the ASP.NET forum855

Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
I was under the impression that for this to work I need to set up IIS correctly, hence the question! I've actually written all my code to do the re-writing its just the set up of IIS I'm stuck with!

 
What exactly are you trying to acheive?

do you want to have page extensions such as .htm, .html, .asp, .php, .whatever parsed through the .net dll?
In which case you need to be setting up the application mappings for each extension required.

Are you trying to make dynamic pages (with querystings eg site.com/page.ext?param=1&param2=2) appear as static URIs (site.com/page/1/2/ for example)

or are you trying to make non (physically) existent pagenames and folders return a page of HTML pulled from a database?

Each are different operations and with the questions and responses you have posted it could be any one of them.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
if they all go to the same page, it's as simple as having a custom 404 page, then anything that doesn't exist lands there and can be analysed and the appropriate output sent.


I do exactly the same thing on the catalogue code I developed. Go to the Cobblers Kids site in my sig and then to the second site in the "Other Projects" links section. None of the category, product listing, product description etc folders/pages actually exist physically on the server, there is just an entry in the database. This uses a scripted 404 page to handle the requests and call the appropriate code.
If this is what you are trying to do but with asp.net then it is an ASP.NET question and you use the web.config to code a series of regular expression (similar to Apache's .htaccess) that does the decoding.

take a look at ASP.NET URLRewriting for more



Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top