URL Routing to Default Page
Posted
by
ewitkows
on Stack Overflow
See other posts from Stack Overflow
or by ewitkows
Published on 2011-01-11T17:44:47Z
Indexed on
2011/01/11
23:53 UTC
Read the original article
Hit count: 164
ASP.NET
|url-routing
Hi everyone, I have an asp.net 4.0 web forms app setup with url rereouting. In development, my app's URL looks perfect. I have a page called enrollnow.aspx that responds to the routing, so if I type in localhost/enrollnow/abc, my app responds as expected.
Once promoted into my staging environment however, the URL is off. I have a domain, and a virtual dir created off of my domain called "enrollnow". So basically, my URL outside of development is: mydomain.com/enrollnow/enrollnow/abc - where the first enrollnow is the directory, the second enrollnow is the page name, and the abc is my route value.
Is there any way I can have the "default page" respond, so the second enrollnow (which is enrollnow.asp) isnt required? Perhaps I can rename my enrollnow.aspx page to default.aspx, or I can change the mapping in my routetable? Heres my routetable, incase that helps. thanks!
Routetable:
RouteTable.Routes.Add("PURLRoute", New Route("EnrollNow/{PURL_ID}", New PageRouteHandler("~/EnrollNow.aspx")))
© Stack Overflow or respective owner