in my blog i set the route with the title of post
route:
pattern: /blog/{id}/{title}
defaults: { _controller: AcmeBlogBundle:Blog:show }
if my title's blog is:
"Hello World"
my route is www.mysite.com/5/Hello World (with space) but i want remove spaces, and use _ like
Hello_World
and i have another question if my title is:
" l'ancora"
how i can remove ' ? thx
i have to add some rules in mod rewrite? RewriteRule ^blog/([^_]*)([^]*?)\d*.php$ blog/$1-$2 [R=301,L]
In your case, the best is to use the Sluggable DoctrineExtension.
And some tips here : How to use Doctrine Extension