0
发现我有以下途径:Symfony的2/3路线不与斜线
product_category:
path: /{grandFatherSlug}/{fatherSlug}/{childSlug}
defaults: { _controller: ProductCategory:productCategoryPage, fatherSlug: "", childSlug: ""}
options:
我想这样的路线以斜线结束,因为SEO的建议。 但我不能让它成功。我曾尝试用:
product_category:
path: /{grandFatherSlug}/{fatherSlug}/{childSlug}/
defaults: { _controller: ProductCategory:productCategoryPage, fatherSlug: "", childSlug: ""}
options:
,但我得到的路由未发现异常,并用:
product_category:
path: /{grandFatherSlug}/{fatherSlug}/{childSlug}/
defaults: { _controller: ProductCategory:productCategoryPage, fatherSlug: "", childSlug: ""}
requirements:
childSlug: .+
fatherSlug: .+
grandFatherSlug: .+
,但我得到附加结尾的斜线,是什么让我打电话给str_replace函数在最后一个参数控制器将其删除。
是否有任何简单的解决方案来实现这种行为?
感谢
http://symfony.com/doc/current/routing/redirect_trailing_slash.html –