Home Rails how to change url for seo
Reply: 1

Rails how to change url for seo

Yalın Semer
Yalın Semer Published in 2017-11-07 09:02:32Z

i am coding a news website. I'm trying to implement best seo practices. For seo , post urls should be like : ( i use friendlyId gem )


But if i use rails style , it generates this url for me:


i tried to override routes like :

resources :post #, :path => "/"

But when i do this , posts work well but i can't access my other routes like :

www.mywebsite.com/contact  www.mywebsite.com/admin

in this way , rails see all pages as post.

I need help to do this !

Nikita Misharin
Nikita Misharin Reply to 2017-11-07 09:59:50Z

Try to put resources :post #, :path => "/" in the end of routes.rb. It should work

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298562 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO