3

We would like to redirect to a localized version of our entry webpage if IP is detected to be from a certain country. We are using ASP.Net, GeoLite Country Db (it's a very small, 1Mb downloadable DB at time of writing this question).

So, most users would get english content, but if they come from a local place, they would have local content served by default. Of course, they would be able to change the preferred language at any time.

The question is: if www.example.com by default displays default.aspx, should we (if we detect the IP to be "local"):

  1. Use "301 Moved Permanently" and redirect it to, say, www.example.com/local.aspx, or

  2. Simply render the appropriate content inside default.aspx?

We would like to know if there are some side effects with SEO or similar issues with any of the approaches?

vgru
  • 49,838
  • 16
  • 120
  • 201

2 Answers2

2

This may not be the best solution.

From wikipedia it says to use 300 for different languages:

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

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

The HTTP standard defines several status codes for redirection:

* 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
John Boker
  • 82,559
  • 17
  • 97
  • 130
  • in the docs it says "If the server has a preferred choice of representation, it SHOULD include the specific URI for that representation in the Location field; user agents MAY use the Location field value for automatic redirection. This response is cacheable unless indicated otherwise." – John Boker Jul 15 '10 at 13:00
  • But the negotiation does not fail in this case. So using 300 is not appropriate. – Gumbo Jul 15 '10 at 13:08
  • And what about 307? Would it serve better than 301 in this case? – vgru Jul 15 '10 at 13:11
1

I would just deliver the localized contents of local.aspx and send an appropriate Content-Location referring to local.aspx along with it.

Or, if you want a redirect, use the status code 307 to indicate a temporary redirect.

Gumbo
  • 643,351
  • 109
  • 780
  • 844
  • 307 seemed appropriate to me also, however HTTP/1.0 agents won't recognize it. I will probably render it. Should I use `Server.Execute` or is there another way? – vgru Jul 15 '10 at 14:51
  • @Groo: You could reply with a 302 in that case. – Gumbo Jul 15 '10 at 15:39