SEO友好的URL如何最好的方法 [英] SEO friendly URL how to best way

查看:63
本文介绍了SEO友好的URL如何最好的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网址如下: http://new2.silentdivers.com/links .php?lang = zh_CN

做SEO友好URL的最佳方法是什么?需要任何帮助.

What will be the best way to do SEO freindly URL? Any help needed.

lang = en可以是lang = ge,lang = fr等

lang=en could be, lang=ge, lang=fr etc

推荐答案

在我看来,最重要的是您需要了解语言应仅基于URL(和/或域).含义URL我的意思是您的脚本应始终仅检查url并决定选择哪种语言.许多人误解了它,并使用cookie或会话来检查它们并选择语言,这对于SEO来说是一个巨大的错误.

In my opinion the most important thing is that you need to understand that language should be only URL(and/or domain) based. Meaning URL I mean your script should always check only url and take decision what language is chosen. Many people misunderstand it and use cookies or sessions to check them and to choose language and it's a huge mistake for SEO.

有3种制作多语言站点的方法.我认为,根据我作为SEO专家的经验,其他任何人实际上都不会对SEO友好

There are 3 methods of making multilingual site. In my opinion and based on my experience as SEO expert any other won't be in fact SEO friendly

方法1

domain.com
domain.com/lang2/
domain.com/lang3/
domain.comm/article
domain.com/lang2/article
domain.com/lang3/article

在这种方法中,您始终检查domain后的lang前缀.如果没有前缀,则显示默认语言.这是最容易实现的方法,几乎​​可以在任何地方使用

In this method you always check lang prefix after domain. If there is no prefix you display default language. It's the easiest method to implement and will work almost everywhere

方法2

  domain.com
  domain.com/article
  lang2.domain.com
  lang2.domain.com/article
  lang3.domain.com
  lang3.domain.com/article 

在这种方法中,您始终需要检查子域来确定语言.优点是您可以为子域执行SEO(许多目录不接受domain.com/lang2/但将接受lang2.domain.com)

In this method you always need to check subdomain do determine language. Pros are that you can do SEO for subdomains (many directories don't accept domain.com/lang2/ but will accept lang2.domain.com )

方法3

domain.com
domain.com/article
domainforlang2.com
domainforlang2.com/article
domainforlang3.com
domainforlang3.com/article

当您确实需要其他域时,此方法将用于较大的站点.有时可能很难找到每种语言的好域名

This method will be for bigger sites when you really need different domains. Disadvantage may be sometimes it's hard to find nice domain for each language

在上面的示例中,文章可以是任何内容,但实际上这部分也应该翻译.因此,例如在英语的方法1中,您可以使用domain.com/en/links/和domain.com/pl/linki(linki是波兰语,英语单词"links"的翻译)

In above examples article can be anything but in fact this part should be also translated. So for example in method 1 for english language you can have domain.com/en/links/ and domain.com/pl/linki (linki is Polish translation for English word "links")

domain.com也仅是示例.它可以是domain.net,domain.org或任何其他域.

Also domain.com is only example. It can be domain.net , domain.org or any other domain.

您必须自行选择方法.对于小型网站,方法1和2就足够了(第二种方法用于更多SEO活动会更好)

You have to choose method on your own. For small sites method 1 and 2 are enough (2nd method for more SEO activities will be better)

编辑

对于方法1 ,您可以使用以下.htaccess:

For method1 you can use this .htaccess :

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)(.*)/?$ index.php

在PHP中,您应该简单检查$_SERVER['REQUEST_URI']

and in PHP you should simple check value of $_SERVER['REQUEST_URI']

在这种情况下,如果它以lang2/或lang3/开头,则表示这是所选语言,否则设置为默认语言.

In this case if it begins with lang2/ or lang3/ it means that's the selected language, otherwise default language is set.

这篇关于SEO友好的URL如何最好的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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