views:

860

answers:

1

I am trying to create a very simple ASP.NET application that presents information out of a datbase based on the URL, similar to a wiki, but in this case the site is read-only. An example of a url I'd like would be:

http://www.foo.com/bar

and then it would use "bar" as a SQL query parameter to show information from a database that matches "bar".

I've looked into many URL re-writer options for IIS6 (and this would be on a dedicated server) but I'm still not sure which one to use for this application.

To perhaps clarify, I only need to run the site off of one default.aspx file, but I want it to work as above. The overall site logic will be very simple.

I am hoping that someone with more experience in this area can help out -- I am looking for the simplest solution that will address this one scenario. Thanks in advance!

+2  A: 

IIS6 only directs requests to the asp.net engine if that extension has been registered. By default the registered extensions are aspx ascx asmx etc...

If you cannot base you database query on a query string parameter (e.g. foo.com/default.aspx?query=bar) then the best you can do on IIS6 is a wildcard mapping. Basically this means that every request will be directed over to asp.net (including images scripts and styles.) obviously this will degrade performance.

To enable wildcard mapping right click on your site in IIS manager and go to Properties -> Home Directory -> Configuration -> Mappings at the bottom click insert and type in the path to the asp.net isapi dll (you can copy it from the aspx extension above) and uncheck 'Verify that file exists'.

After making the changes you'll be able to request foo.com/bar

(another method might be to make a request to foo.com/default.aspx/bar)

Y Low