Crevaoo
(Cleverson)
June 6, 2012, 10:28pm
1
Hi guys… I was playing around with UrlManagement for SEO and come across a question…
I was be able to make the url like this:
produto/detalhe/1/arne-jacobsen-egg-chair-green.html
The rule for that was:
‘<controller:\w+>/<action:\w+>/<id:\d+>/<title:.*?>’ => ‘<controller>/<action>’,
Is there a way for to use a rule so I can get rid of the value of the ID so the url looks like this:
produto/detalhe/arne-jacobsen-egg-chair-green.html (without the /1/) ?
Tanks in advance…
Cleverson
jayant
(Codesutras)
June 7, 2012, 12:28pm
2
Hi guys… I was playing around with UrlManagement for SEO and come across a question…
I was be able to make the url like this:
produto/detalhe/1/arne-jacobsen-egg-chair-green.html
The rule for that was:
‘<controller:\w+>/<action:\w+>/<id:\d+>/<title:.*?>’ => ‘<controller>/<action>’,
Is there a way for to use a rule so I can get rid of the value of the ID so the url looks like this:
produto/detalhe/arne-jacobsen-egg-chair-green.html (without the /1/) ?
Tanks in advance…
Cleverson
Well i have also done the same thing before.
My URL rule was exactly same as yours.
'<controller:\w+>/<action:\w+>/<id:\d+>/<title:\w+>'=>'<controller>/<action>',
But if you want to show URL without ID in URL then dont need to pass a ID in URL and just show a URL slug in URL and Parse it in Action and Continue your code,
Crevaoo
(Cleverson)
June 7, 2012, 1:43pm
3
jayant:
Well i have also done the same thing before.
My URL rule was exactly same as yours.
'<controller:\w+>/<action:\w+>/<id:\d+>/<title:\w+>'=>'<controller>/<action>',
But if you want to show URL without ID in URL then dont need to pass a ID in URL and just show a URL slug in URL and Parse it in Action and Continue your code,
Hi jayant… Could you give-me an example on the slug? Tanks a lot!
jayant
(Codesutras)
June 7, 2012, 1:47pm
4
You can check about a slug behavior on this post