?
Solved

HTTP_ACCEPT_LANGUAGE - Redirect usage

Posted on 2004-08-31
4
Medium Priority
?
461 Views
Last Modified: 2012-05-05
I have a website (www.X.com) that I have set up to support 8 languages.  Based on a query string I load up the correct languages string.  For instance:

www.X.com/about.asp?lang=fr will show French and www.X.com/about.asp?lang=de will show German

This works out great since the user can, if they need to, change langauges very quickly.

What I'd like to do, on the main page (www.X.com/default.asp) and that page only, is the first time teh page is loaded in that session, to guess what the language is and default the page to that.  

So by using Request.ServerVariables("HTTP_ACCEPT_LANGUAGE") to get the language on www.X.com/default.asp, I'd like the page to refresh and somehow work like the others.  So if a user came to default.asp and their language was FR, it would show the French page but allow them to change if necssary.  The best way I figured so far is to, on www.X.com/default.asp, to a Response.Redirect to www.X.com/default?lang=fr 

BUT I thought while surfing the net, that Yahoo! and Google frown on redirects and I don't want to get the site penalized in search rankings.

Any ideas?

Thanks,
CS
0
Comment
Question by:csullins
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:SeanLWilliams
ID: 11946309
redirects are fine if your using them constructively IMO ,  or you  can look at Server.Transfer("url")  which doesn't hit the browser
0
 
LVL 1

Accepted Solution

by:
Buz earned 500 total points
ID: 11951439
Why redirect?

Assuming that your script checks for the value of request.querystring("lang") somewhere in the code, prior to any data display or DB query, all you need to do is: (Sorry for any syntax errors, haven't wrote ASP for a while)

if request.querystring("lang")="" then
  User_Lang = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
else
  User_Lang = request.querystring("lang")
end if

Now use User_Lang in your script as the page language.
0
 

Author Comment

by:csullins
ID: 11957830
That was perfect!  Thanks :)
0

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question