我应该使用301进行现场重定向吗?

时间:2010-07-15 12:46:31

标签: asp.net redirect localization geolocation http-status-code-301

如果检测到来自某个国家/地区的IP,我们希望重定向到我们的输入网页的本地化版本。我们正在使用ASP.Net,GeoLite Country Db(在撰写此问题时,它是一个非常小的1Mb可下载数据库)。

因此,大多数用户会获得英语内容,但如果他们来自本地,他们会默认提供本地内容。当然,他们可以随时更改首选语言。

问题是:如果www.example.com默认显示default.aspx,我们是否应该(如果我们检测到IP为“本地”):

  1. 使用"301 Moved Permanently"并将其重定向到,例如www.example.com/local.aspx

  2. 只需在default.aspx

  3. 中呈现相应的内容

    我们想知道SEO是否存在一些副作用或任何方法的类似问题?

2 个答案:

答案 0 :(得分:2)

这可能不是最佳解决方案。

来自维基百科,它说300用于不同的语言:

http://en.wikipedia.org/wiki/URL_redirection

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.1

  

HTTP标准定义了几个   重定向的状态代码:

* 300 multiple choices (e.g. offer different languages)
* 301 moved permanently
* 302 found (originally temporary redirect, but now commonly used to specify redirection for unspecified reason)
* 303 see other (e.g. for results of cgi-scripts)
* 307 temporary redirect

答案 1 :(得分:1)

我只是提供 local.aspx 的本地化内容,并发送适当的Content-Location引用 local.aspx

或者,如果您想要重定向,请使用状态代码307来指示临时重定向。