In my symfony2 application I want specific routes for my pages, to work well with my seo, but I receive some serious problems and I dont understand them..
EXAMPLE:
Two routes:
blog_article:
path: /blog/{slug}
defaults: {_controller: ApplicationEDBlogBundle:Blog:singleArticle}
product:
path: /{category}/{name}
defaults: { _controller: MpShopBundle:Product:view}
The product
route works fine, but the blog_article
route always redirects to product
route..
In my understanding if i open blog: /blog/firstBlog/
by default it thinks that the blog is a category and firstBlog is the product name, because my product
route is the last route.
But if in my twig i specificaly tell which route to go to, shouldnt it work?
For example: {{ path('blog_article', {slug: blog.slug}) }}
. Shouldnt this look at the blog_article
route and open the needed controller? Or it does not work like that?
If so, how to keep my pretty urls the way I want to?