Hello,
I've implemented url routing with the following rule:
string virtualPath = "~/" + requestContext.RouteData.Values["page"].ToString();
//if virtualpath doesn't end in aspx, then it's just a directory path loading
//default.aspx by default.
if (!virtualPath.EndsWith(".aspx") && !virtualPath.EndsWith(".txt"))
{
virtualPath += "default.aspx";
}
return BuildManager.CreateInstanceFromVirtualPath(
virtualPath,
typeof(Page)) as Page;
This works perfectly fine as long as it's on my development machine running under asp.net development server.
For example, the following url: localhost:3328/en/Products/ will load default.aspx located under /Products/ /en/ directory obviously doesn't physically exist.
However it'll fail to load when publishing to qa.mysite.com so it'll fail when going qa.mysite.com/en/Products It gives the 404 page not found.
it works if I go qa.mysite.com/en/Products/default.aspx
So it's not really url routing that's not working, I'm thinking it's some settings? I'm running iis6.