URL rewriting without a file extension RRS feed

  • Question

  • User66665886 posted

    Hi All,

    This has been bugging me all week!

    I wish to create a tag based system where users can go to http://www.mysite.com/tag/phones+handsets

    This works well when I build it using vs 2005 built in web server. As soon as i deploy it on an iis webserver, it breaks! i am using the URL Rewriter module from http://www.urlrewriting.net/

    To give you a better understanding of what i'm talking about, I have packaged a simple visuual studion web application which can be dowloaded at this URL : http://www.impulsionsoft.com/tags.zip

    To replicate my error, please run the application with vs 2005 inbuilt web server and browse to say: http://localhost:2325/Tags/tag/software+hardware

    The URL is successfully written. Now build the site and deploy as an IIS application, suddenly, it stops working.

    I have read the URL rewriting article on MSDN by Scott M, and it does not address this issue.

    It's probably too much to ask, but my client says PHP, might be the way if we cannot achieve this with .net, implying that i'll loose the project since i'm not touching PHP.

    Kind Regards

    Wednesday, April 26, 2006 12:26 PM

All replies

  • User1385293158 posted


    I've found the following in the FAQ of UrlRewritingNet:

    04. Are Rewrites possible without a Fileextension?

    No, this is not possible because these requests are directly not handled by ASP.NET 2.0

    Maybe this is the reason it doesn't work on IIS

    Wednesday, April 26, 2006 3:35 PM
  • User-2001980297 posted

    Since you have read Scott M's article, I think you can easily understand when there is no file extension, IIS will will treat it as a directory and try to find a default page under it. If IIS cannot find that kind of page, it returns 404 error and ASP.NET has no chance to deal with it because the request has not yet come to asp.net engine.

    To solve this problem, I think there are two way.

    One is to write a filter for IIS but it is quite hard. If you have some idea on SPS or "SQL support in IIS", you may understand how it works.

    Two is to configure IIS and let all the file to be handled by ASP.NET engine. Then the IIS will not examine whether the file exists or not. Actually, this method is mentioned in Scott M's article. The only shortcoming of it is that you have to deal with static files (htm, gif, css and so on) by yourself. IIS just pass all the request to asp.net and will no longer handle these files.

    Wednesday, April 26, 2006 9:46 PM
  • User66665886 posted
    Thanks guys for your input, at least i know what other options that are available.
    Wednesday, April 26, 2006 11:21 PM