The reason is that you have default values set for :year and :month, so they get "filled in", when not specified.
On Sunday, February 15, 2015 at 10:43:27 AM UTC+1, Stanislav Blinov wrote: > > Hi, > I have a route: > $r->get('/news/:year/:month' => [month => qr/\d{2}/, year => > qr/\d{4}/])->to(controller => 'news', action => 'view', year => 2015, month > => 01, page => 1, id => $news_id); > > My intention is that it only should work for these type of urls: > /news/ > news/2015/ > news/2015/01 > > However, it also works when I call /news.html > > What is wrong with it? > I have also tried adding .html to another routes and it seems that they > open the same page as a route without .html > > Mojolicious 5.79. > > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to mojolicious+unsubscr...@googlegroups.com. To post to this group, send email to mojolicious@googlegroups.com. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.