1

I'm getting this awkward and embarrassing and somewhat heinous (sp?) and egregious error within MonoRail intermittently. When users go to the homepage of the site they get the error:

Url smaller than 2 tokens

Usually after 5-15 minutes the error will stop but it comes back regularly. It only happens on the homepage because it is the domainname.com and it doesn't throw this exception if the url has a subdirectory. It's the silliest Monorail error ever, as why would you want to throw an error if someone is on the homepage of your site?

Anyway, here is the route rule that supposedly should take care of this issue but does not:

 RoutingModuleEx.Engine.Add(
                new PatternRoute("Home", "/[controller]")
                    .DefaultForArea().IsEmpty
                    .DefaultForController().Is("Home")
                    .DefaultForAction().Is("Index")
                );

Any ideas? I'm hoping the Monorail gurus can help me out.

4

1 回答 1

0

我使用一个 Default.aspx 文件供 IIS 捕获,然后在 web.config 或 global.asax 中,将其 urlrewrite 到我的主页操作。这总是对我有用。

于 2011-06-17T08:08:33.187 回答