locked
remove .aspx extension on every asp.net pages RRS feed

  • Question

  • User1210363811 posted
    Hi, How can i set my IIS web server to not to show the extension of every pages. I see this in many website like yahoo and msn. Is this done using a cutom httphandler? I want to do something like below. http://www.mysite.com/aspxpage?transactionid=12345 this website is created using asp.net 2.0. thanks.
    Monday, September 18, 2006 5:04 AM

Answers

  • User-1853252149 posted

    Yahoo doesn't use IIS, in Apache/Unix/Linux/etc. based systems the file extension isn't used to determine the file type as it is in Windows.  MSN uses URL redirection and some custom ISAPI work.  Unless you're going to write an ISAPI filter for this, your best bet is to forget the idea, especially if it's just cosmetic.  Windows expects file extensions and maps actions to them.  You can map a wild cad extension to the ASP.NET DLL, but every file will get processed as ASP.NET so you have to deal with that as well.

    Jeff

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 18, 2006 9:28 AM

All replies

  • User-1853252149 posted

    Yahoo doesn't use IIS, in Apache/Unix/Linux/etc. based systems the file extension isn't used to determine the file type as it is in Windows.  MSN uses URL redirection and some custom ISAPI work.  Unless you're going to write an ISAPI filter for this, your best bet is to forget the idea, especially if it's just cosmetic.  Windows expects file extensions and maps actions to them.  You can map a wild cad extension to the ASP.NET DLL, but every file will get processed as ASP.NET so you have to deal with that as well.

    Jeff

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, September 18, 2006 9:28 AM
  • User1210363811 posted

    Hi jeff,

    Thanks. Do you have any site recommended teaching like the one you mentioned MSN uses? Its only not for cosmetic but to have a deep knowledge and understanding on how it works.

     Thanks again.

     

    Monday, September 18, 2006 8:23 PM
  • User-1688778083 posted

    Hi marvz.

    What you want to do is URL rewriting. You can find a pretty good explanation of this technique in this MSDN article from Scott Mitchell.

    Sunday, September 24, 2006 6:20 AM
  • Sunday, September 24, 2006 8:53 AM
  • User812619520 posted
    Built-in rewriting as described on MSDN is fine if you don't mind .aspx or .html at the end of your urls. But if you don't want this, check out the free ISAPI rewrite 4:

    http://cheeso.members.winisp.net/IIRF.aspx

    It's really great, although you can't install this on shared hosting as it's an isapi filter. The setup is easy, and you can figure it out even if you don't know regular expressions (it comes with instructions in the sample configuration file).

    Otherwise you would need to create a real directory for each virtual url you want. That's probably a bad way to go imho.
    Sunday, September 24, 2006 4:19 PM
  • User812619520 posted
    I should also mention that this isapi filter is much better than simply mapping everything to the ASP.NET engine--if you are serving up a GIF or CSS there is no need to use any of the overhead that the ASP.NET engine uses.
    Sunday, September 24, 2006 4:21 PM