Rails 网站的 SEO,现在还是以后?

发布于 2024-09-13 10:40:18 字数 764 浏览 4 评论 0原文

我的自由 Web 开发人员正在 Ruby on Rails 上开发一个网站。目前 URL 结构为

http://abc.com/all?ID=category

示例:

http://abc.com/all?3=CatA< /a>

我要求他根据类别构建 URL,例如

http://abc.com/CatA/3-page-title

但他拒绝了,因为这涉及太多的工作和成本,因为他对 A 类、B 类使用相同的模型。 .. 我认为他使用的 URL 结构很混乱,而且对搜索引擎不友好。

我的问题是,我应该增加成本让他做我请求的更好的结构化 URL,还是应该让项目完成,然后在下一次迭代中完成?

我担心如果我在下一次迭代中这样做,以前以旧方式构建的所有 URL 都将被清除,并且引用它的网站将显示 404 错误。这就像我必须重新重建网站排名一样。

对我来说还有其他解决方案吗?有没有办法在 Rails 中自动将旧 URL 重定向到新 URL?

My freelance web developer is developing a site on Ruby on Rails. Currently the URL structure is

http://abc.com/all?ID=category

Example:

http://abc.com/all?3=CatA

I requested him to structure the URL according to categories, such as

http://abc.com/CatA/3-page-title

but he refused cos it was too much work and cost involved as he is using the same model for Category A, Category B... I thought the URL structure that he is using is messy and not search engine friendly.

My question is, should I add cost to let him do a better structured URL I requested, or should I let the project finish, then do it in the next iteration?

I'm worried that if I do it in the next iteration, all the previous URLs structured in the old way will be purged and when sites that refer to it will show a 404 error. It's like I have to rebuild the site ranking all over again.

Any other solutions for me? Is that any way to redirect old URLs to new URLs automatically in Rails?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

双马尾 2024-09-20 10:40:18

您的开发人员提议的编写 URL 的方式将被视为 Rails 的反模式。您正在寻找的内容与 Rails 在使用 RESTful 资源路由时开箱即用的操作很接近,诚然,我猜测 CatApage-title 彼此相关。 RESTful Rails 路线可能如下所示(使用您的示例):

http: //abc.com/categories/3-CatA/pages/10-page-tite

如果他真的在使用 Rails,并且他知道自己在做什么,那么转换为您的内容应该没有任何成本想。它只需要定义正确的路由,然后在模型中覆盖 to_param 即可获得良好的 SEO 友好标识符。

The way your developer is proposing to compose the URLs would be considered something of an anti-pattern is Rails. What you are looking for is close to what Rails does out-of-the-box when using RESTful resource routing, admittedly, I'm guessing as to how CatA and page-title are related to each other. A RESTful Rails route might look like this (using your example):

http://abc.com/categories/3-CatA/pages/10-page-tite

If he really is using Rails, and he knows what he's doing, then there should be no cost at all to converting to what you want. It just needs the correct routes defined and then a to_param override in your models to get the nice SEO friendly identifiers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文