What do you do when matching a static file? Do you explicitly check the filesystem for existance?
I think I'd still keep my static-folder for content that always will be static (to avoid unnessecary processing of files through MR), but for certain root-files this approach isn't applicable. Henrik Feldt wrote: > Hello Jimmy, > > What I did, was to modify the routing in the routing module and also add a > property "IsStaticFile" on the RouteMatch, so that the routing, which is > responsible for rewriting the url, checks for static files, rather than > letting MRHttpHandlerFactory do it. What MRHHF does is to check if the route > is for static. > > I also made the routing aware of the controller tree, because in my opinion > there's no use in routing to mr handlers if there's no controller/action for > the route anyway; then we might fail with ASP.Net's error handling (+ being > able to set 404 pages through web admin API in IIS7, or error handlers in > web.config in iis6) like default and save ourselves the trouble of mapping > every single file extension manually in Web.config. > > Regards, > Henrik > > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Jimmy Shimizu > Sent: den 20 maj 2009 12:22 > To: [email protected] > Subject: Re: robots.txt and sitemaps with routing > > > I'm using RoutingModuleEx, basic MonoRail routing that is mapped like this: > > <add name="MonoRail" path="*" verb="*" > type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, > Castle.MonoRail.Framework" preCondition="integratedMode"/> > > I was under the impression that with this approach, static files are never > handled correctly. If that is not the case, I'd love to hear about the > solution :) > > I get Url smaller than 2 tokens if I try to request a static file. > > Jokin Cuadrado wrote: > >> What routing are you using? >> >> the one i use check if a file exist before handling the dynamic url, >> so just put a static robot.txt in the root and it will work. >> >> >> On Mon, May 18, 2009 at 12:01 PM, Jimmy Shimizu <[email protected]> >> > wrote: > >> >> >>> How do you guys solve the issue with files that are supposed to be >>> found directly under the siteroot when using advanced routing >>> (meaning, catching * with Monorail)? >>> >>> I was planning on using a specific controller that servers robots.txt >>> and sitemaps dynamically, but when someone needs to verify for >>> example domain-ownership with analytics or webmastertools or such, >>> how do you handle that? >>> >>> >>> >> >> >> > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en -~----------~----~----~----~------~----~------~--~---
