ASP.NET MVC twitter/myspace style routing -


this first post after being long-time lurker - please gentle :-)

i have website similar twitter, in people can sign , choose 'friendly url', on site have like:

mydomain.com/benjones

i have root level static pages such as:

mydomain.com/about

and of course homepage:

mydomain.com/

i'm new asp.net mvc 2 (in fact started today) , i've set following routes try , achieve above.

    public static void registerroutes(routecollection routes)     {         routes.ignoreroute("{resource}.axd/{*pathinfo}");         routes.ignoreroute("content/{*pathinfo}");         routes.ignoreroute("images/{*pathinfo}");          routes.maproute("about", "about",             new { controller = "common", action = "about" }         );          // user profile sits @ root level check before displaying homepage         routes.maproute("userprofile", "{url}",             new { controller = "user", action = "profile", url = "" }         );          routes.maproute("home", "",             new { controller = "home", action = "index", id = "" }         );     } 

for part works fine, however, homepage not being triggered! essentially, when browser mydomain.com, seems trigger user profile route empty {url} parameter , homepage never reached! ideas on how can show homepage?

can not swap bottom 2 routes?


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -