Symfony2索引路由2个参数

I want have this urls:

example.com
example.com/category
example.com/category/name

My routes:

default_page:
    path:     /{name}
    defaults: { _controller: CatalogWebBundle:Default:index }
default_page:
    path:     /
    defaults: { _controller: CatalogWebBundle:Default:index }
default_page:
    path:     /{name}/{category}
    defaults: { _controller: CatalogWebBundle:Default:index }

Work properly only

example.com/category

What is wrong with my routes ?

Error is:

No route found for "GET /category/name"
No route found for "GET /"

make your internal name of the route unique and it should work properly.

default_page_X:
    path:     /{name}
    defaults: { _controller: CatalogWebBundle:Default:index }
default_page_Y:
    path:     /
    defaults: { _controller: CatalogWebBundle:Default:index }
default_page_Z:
    path:     /{name}/{category}
    defaults: { _controller: CatalogWebBundle:Default:index }

braces are for variables. When you type .com/category it will go into your first route with "category" as value of the variable name