Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

Last post 05-02-2008 3:59 AM by hudo. 6 replies.

Sort Posts:

  • Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-01-2008, 3:59 AM
    • Loading...
    • Praetorian22
    • Joined on 04-28-2008, 5:51 AM
    • Australia
    • Posts 2

     Hi all,

      I have built a working MVC app (with preview 2) and all is good except that my URLs contain .mvc.aspx in order to work.  I had anticipated this (and tested with IIS6 locally), however it will only work with the extended mapping.

     
    I found this by chance on another post in these forums, and tried it out of frustration.  Why is is required?  Why can't I just use .mvc (for now, until II7.0), as per the comment within global.asmx.cs

     
    In summary, it works correctly on my local IIS6, but not on the hosted domain.  I asked the hosting service to setup the mapping, which they claim to have done, so I thought it should all be good.

     
    Any ideas?

     
    Thanks

     PS - loving the MVC - good work!

  • Re: Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-01-2008, 6:53 AM
    • Loading...
    • aspevia
    • Joined on 04-25-2003, 8:36 PM
    • Boston, MA
    • Posts 26

     I don't know about all hosting companies, but on webhost4life I have it working with the .mvc extension.  Plus webhost4life lets you set up the mappings yourself, so I did not have to rely on them to do it.

     
     

    Trevor de Koekkoek
    Aspevia Systems
  • Re: Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-01-2008, 7:22 AM
    • Loading...
    • hudo
    • Joined on 05-08-2007, 5:11 PM
    • Croatia
    • Posts 37

    Hosting company must register .mvc to asp.net isapi dll. With my hosting company, I just tell them which extension I want to be mapped.

    You can test this by making one asp.net page with that extension (.mvc, not .aspx), just "hello world" on page, publish it to web server and try it.  Page should be processed by asp.net isapi, and codebehind should be executed. If it doesn't work, then call you hosting company.

    #define QUESTION ((bb) || !(bb))

    Hear me tweetting
  • Re: Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-01-2008, 7:34 AM
    • Loading...
    • tgmdbm
    • Joined on 12-17-2007, 9:08 AM
    • Posts 584
    • ASPInsiders

    I encountered this too. and the host my client was using wouldn't change the config :(

    but the extension doesn't need to be .mvc.aspx, it just needs to be .aspx

     

  • Re: Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-01-2008, 7:47 AM
    • Loading...
    • hudo
    • Joined on 05-08-2007, 5:11 PM
    • Croatia
    • Posts 37

    Yes, it can be any extension that is mapped to asp.net isapi. You can see what's mapped in IIS, or just google it.

    But, it's strange why hosting company don't want to change this? Maybe some security reason, or they are just lazy :)

    If they are willing to make changes, maybe it'll be better to use .html extension, easier to remember for non-tech people ...Then people will see web site and ask them selfs, how can be that fast if its written in php (it doesn't have .aspx and all the craps in source!). Then you can show how its made, and they will convert all theirs php sites to asp.net mvc!! :)

    #define QUESTION ((bb) || !(bb))

    Hear me tweetting
  • Re: Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-01-2008, 9:04 PM
    • Loading...
    • Praetorian22
    • Joined on 04-28-2008, 5:51 AM
    • Australia
    • Posts 2

    hudo:
    Yes, it can be any extension that is mapped to asp.net isapi. You can see what's mapped in IIS, or just google it.
     

    I tried this - both html and aspx, but they don't work.  Which makes sense since they'll be configured to require the file to exist, but obviously the MVC controller is not a file.

    I contacted the domain hosting company, and it turned out that with the mvc extension, they hadn't turned off this flag (file exists) but it still didn't fix my initial problem.

    Any other ideas?  At this stage, I'm going to just use mvc.aspx and work out how to implement ISAPI rewrite to hide the ugly URLs
     

  • Re: Routing with IIS6.0 with extension mapping - requires .mvc.aspx on hosted domain

    05-02-2008, 3:59 AM
    • Loading...
    • hudo
    • Joined on 05-08-2007, 5:11 PM
    • Croatia
    • Posts 37

    Flag "check if file exists" in iis should be turned off, but i suppose they uncheck it...

    If I understood, you say that something.mvc.aspx works, but something.aspx doesn't? That shouldn't be happening ...

    With MonoRail mvc, i often used controller/action.html (or something1/something2/something3.aspx, route defined to controller something1, action something2, id something3) or some other asp.net isapi mapped extension. Make proper changes in routes definition and try with that... 


    #define QUESTION ((bb) || !(bb))

    Hear me tweetting
Page 1 of 1 (7 items)