我有一个多语种网站。如何添加参数或URL没有太多的工作? [英] I have a multilingual website. How do I add parameters or a URL without too much work?

查看:164
本文介绍了我有一个多语种网站。如何添加参数或URL没有太多的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个公司网站(Visual Studio中/ VB / ASP.NET 4.0)。我本地化我的网站在10种不同的语言和文化。

I have a company website (Visual Studio / VB / ASP.NET 4.0). I localized my website in 10 different languages and cultures.

问题:虽然@Stefan指出,谷歌不会惩罚我重复的内容,所有我的网址都是一样的。例如,about.aspx英语仍about.aspx法语 - 它刚刚从FR资源文件,而不是在连接资源文件调用页并相应地显示它。 所以URL永远不会改变,虽然页面变化的语言。

The Problem: Although @Stefan noted that Google will not punish me for duplicate content, all of my URLs are the same. For instance, about.aspx in English is still about.aspx in French -- it just calls the page from the "fr" resource file instead of the "en" resource file and displays it accordingly. So the URL never changes, although the language on the page changes.

@Aristos建议我加的参数网址我的网站,我不反对。这将使客户了解他们在法国的部分或网站的瑞典部分,也许是Googlebots,Yahoobots,会喜欢这个更多。其实,我觉得我真的很喜欢这个建议。

@Aristos suggested I add a parameter or a URL to my website, which I'm not opposed to. This will allow clients to understand they're in the French portion or the Swedish portion of the website, and perhaps Googlebots, Yahoobots, will like this more. Actually, I think I REALLY like this suggestion.

我想,当他说添加参数是什么@Aristos被暗示是,我会在网址的结尾about.aspx?LANG = FR或东西。我现在的链接看起来是这样的:

I think what @Aristos was suggesting when he says "add a parameter" was that I would have about.aspx?lang=FR or something at the end of the URL. My current links look like this:

                    <asp:LinkButton ID="LinkButton7" runat="server"
       CommandArgument="nl" OnClick="RequestLanguageChange_Click" class="flagbutton">
           <asp:Image ID="Image1" runat="server" ImageUrl="~/images/flagnl.png" tooltip="Bekijk deze website in het Nederlands" title="Bekijk deze website in het Nederlands"/>
           <img class="map" src="images/flaghovernl.png" alt=""/>
    </asp:LinkButton>

但我怎么添加参数?会不会是一个复杂的过程?我所有的资源文件都在App_GlobalResources文件。我正在寻找,这将是最友好的搜索引擎优化的简单的解决方案。这方面的指导,将真诚AP preciated!

But how do I add a parameter? Will it be a complex process? All of my resource files are in app_globalresources. I'm looking for the simplest solution that will be the most SEO friendly. Any guidance in this regard would be sincerely appreciated!

推荐答案

现在让我们看看你的新问题。我在这里看到的也是一个非好的SEO和NOT最佳实践的方法来改变语言。

Now let see your new question. What I see here is also a non good SEO and NOT best practice way to change language.

和的原因是,你使用回发来更改语言。和索引从不回来后在页面上,罕见运行JavaScript - 与LinkBut​​ton是调用回发一个JavaScript。当您插入数据,或做一个动作它很好用后只回来,如果发现搜索引擎你不关心或按照最新的帖子后面了。

And the reason is that you use post back to change the language. And indexers never make post back on pages, rare run javascript - and the LinkButton is a javascript that call a post back. It good to use post back only when you insert data, or made an action, and you do not care if search engines found or follow whats after the post back.

什么是真正必须做的是创建一个简单的链接,更改语言,而不是回发。

What actually must do is to create a simple link that change the language and not a post back.

<a href="about.aspx?lang=el">ellinika</a>

现在,在你的 pageLoad的您检查,看看如果你发现这个参数 LANG =报如果你发现它告诉你这个语言资源,如果你不显示默认的资源。

Now, on your PageLoad you check to see if you find this parameter lang=el and if you find it you show this language resource, if not you show the default resource.

您也可以稍后进行URL重写和转换 about.aspx?LANG =报,到 /el/about.aspx

You can also later make a url rewrite and convert the about.aspx?lang=el, to /el/about.aspx

这篇关于我有一个多语种网站。如何添加参数或URL没有太多的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆