Rails - 重定向操作的搜索引擎索引

发布于 2024-10-09 03:40:43 字数 481 浏览 10 评论 0原文

我有一个多语言网站,具有不同语言的相同内容,并且具有描述性 SEO 网址,其中包含每个页面文章的标题。为了在翻译文章的所述语言之间进行切换,我有一个操作可以使用先前的语言查找翻译的标题并重定向到它。这一切都工作正常,除了我注意到,尽管没有视图,谷歌已经对所述重定向网址建立了索引。

这是不好的做法吗?我不想进行 301 重定向,因为似乎每个页面上都有 301 重定向的链接是一个非常糟糕的主意。我是否以某种方式包含元标记还是有其他方法?

我目前这样做的原因是我希望每个文章页面使用每个页面顶部的标志链接到其所有翻译。我想得越多,我应该生成直接网址,因为这本身可能有搜索引擎优化的好处。我最初没有走这条路的原因是页面渲染速度。我必须仅查找多篇文章的 url slug,并在任何标题更改时使所有语言的缓存过期(这是 wiki 风格的用户生成的内容)。另外,在某些情况下,不存在翻译,在这种情况下,我需要链接到带有闪存消息的文章类别。

因此,在写作时仔细考虑一下,如果解决方案更难实现,这似乎是更好的选择?

I have a multilingual site with the same content in different languages with descriptive seo urls incorporating the title of each pages article. To switch between said languages of translated articles I have an action which looks up the translated title using the previous language and redirects to it. This all works fine except I noticed, despite there being no view, google has indexed said redirect urls.

Is this bad practice? I don't want to 301 redirect as it seems having links on every page to 301 redirects is a really bad idea. Do I somehow include a meta tag or is there some other approach?

The reason I currently have this is I want each article page to link to all of its translations using flags at the top of each page. The more I think about it I should just generate the direct url as this itself may have seo benefits. The reason I didn't go down this path originally was page rendering speed. I'd have to look up multiple articles solely for their url slug and expire caches of all languages upon any title change (it's a wiki style user generated content). Also, in some cases a translation wouldn't exist in which case I would need to link instead, say, to the category of article with a flash message.

So thinking through this while writing maybe this seems the preferable if more difficult to implement solution?

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

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

发布评论

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

评论(2

享受孤独 2024-10-16 03:40:43

嘿,马克,从搜索引擎的角度来看,如果只是为了性能,您绝对不想到处依赖重定向。搜索引擎根据排名为每个网站分配一定量的带宽,如果您重定向每个页面,您会消耗比您需要的更多的带宽,并且可能无法像其他方式那样抓取尽可能多的内容。

生成本地化 URL 并将其粘贴在页面顶部的第二种解决方案是搜索引擎的最佳选择。这将为每个页面提供唯一的 URL,并提供 Google 和 Bing(例如雅虎)可以跟踪和索引的每个页面的直接链接。

我提供了一套 SEO 和搜索引擎优化的最佳实践。另一个 stackoverflow 问答上的本地化网站,这里有一个链接,我想您也会发现它很有价值:国际化和搜索引擎优化

祝你好运!

Hey Mark, from a search engine perspective you definitely don't want to rely on redirects everywhere, if for nothing other than performance. Search engines allocate a certain amount of bandwidth to each site based on ranking, if you're redirecting every page, you're eating up more of that bandwidth than you need to, and potentially not getting as much content crawled as you could otherwise.

Your second solution of generating the localized URLs and sticking them at the top of the page is the best option for search engines. That will give a unique URL for each page, and will provide a direct link to each page that Google and Bing (e.g. Yahoo) can follow and index.

I provided a set of best practices for SEO & Localized sites on another stackoverflow Q&A, here's a link, I think you'll find it valuable too: Internationalization and Search Engine Optimization

Good luck!

素罗衫 2024-10-16 03:40:43

我正在构建一个支持十种语言的应用程序:英语、简体中文、繁体中文、法语、西班牙语、俄语、日语、德语和印地语。

我尝试了很多事情,但最终我做的是将 :en 设置为默认值,然后根据请求的来源进行切换,然后在使用注册时他们可以设置默认语言。因此,如果来自中国大陆,我使用 :scn,如果来自香港,我使用 :tcn 繁体中文/简体中文。

通过这种方式,应用程序可以维持语言的状态并且没有重定向。

我认为任何重定向都会很麻烦,所以我不会这样做。另外,我正在制作一个动态站点地图,它将列出所有指向 google 的链接,每个“页面”将有 10 种不同的翻译。

我还没有部署我的应用程序,所以我无法检查中文搜索引擎等...以查看他们是否正在索引我的内容。

I have an app that I'm building that supports ten languages: English, simplified and traditional Chinese, French, Spanish, Russian, Japanese, German, and Hindi.

I tried a number of things but what I ended up doing was making :en default and then switching by where the request was coming from and then when uses signup they can set a default language. So if it was coming from mainland China I use :scn, and if it comes from Hong Kong I use :tcn traditional Chinese/simplified Chinese.

This way the application maintains a state of a language and there is no redirection.

I think any redirection is going to be troublesome so I wouldn't do that. Also, I am working on a dynamic site map that will list all of the links to google, which will have 10 different translations per 'page'.

I haven't deployed my application yet so I cannot check the Chinese search engines etc... to see if they are indexing my content.

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