I'm trying to create a route for an RSS feed which allows for the following routes.
domain/feed
domain/category/feed
domain/category/subcategory/feed
I have the first two routes working and the category fetching logic looks okay to me.
So far in my routes file I have the following
'feed' => 'feed/_index.twig',
'(?P<slug>[^/]+)/feed' => 'feed/_index',
// Additional New route
'(?P<slug>[^/]+)/(?P<slug>[^/]+)/feed' => 'feed/_index',
That last line was added recently as I thought the child category would include the parent category in its route.
I either get a 404 error without that new route, or when I do add that third route I get the following error
preg_match(): Compilation failed: two named subpatterns have the same
name at offset 27 (craft/app/etc/web/UrlManager.php:387)
Any help would be greatly appreciated.
<slug>
). According to stackoverflow.com/a/7166444/684, you can do that as long as you use the(?J)
option in your pattern. Not sure if that's going to solve your overall problem, so just adding this as a comment. – Brad Bell Jul 15 '15 at 2:02