MVC URL Routing overrides Directory Listing

Last post 04-24-2008 12:39 PM by Peter Meir. 2 replies.

Sort Posts:

  • MVC URL Routing overrides Directory Listing

    04-22-2008, 4:01 AM
    • Loading...
    • Peter Meir
    • Joined on 04-09-2008, 6:27 AM
    • Belgium
    • Posts 8

    Hi,

    I have been playing around for quite a while now with the MVC Routing classes and have implemented a near perfectly working alternative solution for url rewriting.
    One last issue to overcome is the following:

    When you want to route from http://myurl.com/animals  to http://myurl.com/themehome.aspx?category=animals this is only possible if there is no existing ~/animals folder. If there is one, the link will automatically open the standard 'Directory Listing'-page instead of going through the routing logic.

    Does anyone have any idea to get around this without renaming this folder 'animals' into something else?


    Thanks a lot!

    Peter

     

    Don't forget to click "Mark as Answer" on the post(s) that helped you. This credits that member, earns you a point and marks your thread as Resolved.
    Pinky: Hmmm... let me think...
    Brain: Don't hurt yourself, Pinky.
  • Re: MVC URL Routing overrides Directory Listing

    04-24-2008, 8:18 AM
    Answer

    Hi Peter,

    By default, DirectoryListingModule take precedence over UrlMappingsModule. Fortunately, it is possible to change the order of UrlMappingsModule and DirectoryListingModule.

    Goes to IIS7 Manager -> Modules, in the right pane, click View Ordered List, you can then use Move Down, Move Up to change the order of modules.

    Zhao Ji Ma
    Sincerely,
    Microsoft Online Community Support

    “Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
  • Re: MVC URL Routing overrides Directory Listing

    04-24-2008, 12:39 PM
    • Loading...
    • Peter Meir
    • Joined on 04-09-2008, 6:27 AM
    • Belgium
    • Posts 8

    Thanks Zhao Ji Ma that helps a lot and solved my issue!

    Although I don't have access to the production database, I know now how it can be solved.

    Don't forget to click "Mark as Answer" on the post(s) that helped you. This credits that member, earns you a point and marks your thread as Resolved.
    Pinky: Hmmm... let me think...
    Brain: Don't hurt yourself, Pinky.
Page 1 of 1 (3 items)