My (rails 3.1) site currently does routing for objects using ids like so: /object/show/:id
For seo and url prettification, I’d like to change them to /object/show/:id/:title or something similar.
I still want to use ids to do the db lookup for performance and simplicity, so the addition of :title would be purely cosmetic.
Given this, would keeping the a tag hrefs on my site pointing to /object/show/:id and then doing a 301 permanent redirect to my new url scheme be an seo-friendly way of getting object titles into my urls? Are there any drawbacks to pointing my hrefs at the old scheme? Many are hardcoded to the original scheme, so we’d like to avoid the chore of inserting titles across the codebase if it’s unnecessary. Thanks!
If you leave the hrefs to the old URLs then all the links will redirect.
This means all visitors will get a slightly slower experience and Google will leak some of the PageRank that gets passed between links.
Avoid it if possible.