Home Rails how to change url for seo
Reply: 1

Rails how to change url for seo

Yalın Semer
1#
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 )

www.mywebsite.com/blog-post-title 

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

www.mywebsite.com/post/blog-post-title 

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
2#
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.300622 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO