I have some script in my default page that redirects users to language specific versions of my website depending on the language of the browser. I want to add something that redirects those users who do NOT have Javascript enabled.
Currently I have the following :
<noscript>
<META HTTP-EQUIV=REFRESH CONTENT="1; URL=en/index.htm">.
</noscript>
But I've read this is not too wise as some search engines frown upon it. How do I do this and keep search engines happy?
It could be done with a server side language by adding the following http header
will redirect the user to http://www.example.com/en/index
You can redirect at server side with 301 HTTP status code too. This is the best way to do it for good SEO. The example is in C# but every plattform has his own method to add headers to the response:
The reason to use the 301 status code is that the search engine indexes the new page because it was "Moved permanently" instead of the 302 that was "Moved temporarily".
Why don't you redirect on the server side, by responding with a 302 HTTP status code. I don't know what you have on the server, but all frameworks support it.
You'll need to parse the
Accept-Language
HTTP header.You should use a .htaccess file to detect the browser's language from the headers (using a regular expression) and then redirect them that way. Doing that is completely agnostic of the client-side configuration and search engines will handle it properly. There is a ton of information out there on specifically how to accomplish this.