Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3787048
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:46:46+00:00 2026-05-19T11:46:46+00:00

I want to know if the user is browsing from the UK, or using

  • 0

I want to know if the user is browsing from the UK, or using a UK browser. If not, I can safely assume that they are a US visitor.

I can lookup their IP in a database, but this is a bit slow and I’d rather just find out from their User-agent or some other HTTP header.

It doesn’t matter if it’s not always correct, and there are ambiguities (such as someone using a US computer in the UK).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:46:47+00:00Added an answer on May 19, 2026 at 11:46 am

    You could probably check for Accept-Language header field.

    14.4 Accept-Language

    The Accept-Language request-header
    field is similar to Accept, but
    restricts the set of natural languages
    that are preferred as a response to
    the request. Language tags are defined
    in section 3.10.

       Accept-Language = "Accept-Language" ":"
                         1#( language-range [ ";" "q" "=" qvalue ]
    

    )
    language-range = ( ( 1*8ALPHA *( “-” 1*8ALPHA ) ) | “*” )

    Each language-range MAY be given an
    associated quality value which
    represents an estimate of the user’s
    preference for the languages specified
    by that range. The quality value
    defaults to “q=1”. For example,

       Accept-Language: da, en-gb;q=0.8, en;q=0.7
    

    would mean: “I prefer Danish, but will
    accept British English and other types
    of English.” A language-range matches
    a language-tag if it exactly equals
    the tag, or if it exactly equals a
    prefix of the tag such that the first
    tag character following the prefix is
    “-“. The special range “*”, if present
    in the Accept-Language field, matches
    every tag not matched by any other
    range present in the Accept-Language
    field.

      Note: This use of a prefix matching rule does not imply that
      language tags are assigned to languages in such a way that it is
      always true that if a user understands a language with a certain
      tag, then this user will also understand all languages with tags
      for which this tag is a prefix. The prefix rule simply allows the
      use of prefix tags if this is the case.
    

    The language quality factor assigned
    to a language-tag by the
    Accept-Language field is the quality
    value of the longest language- range
    in the field that matches the
    language-tag. If no language- range in
    the field matches the tag, the
    language quality factor assigned is 0.
    If no Accept-Language header is
    present in the request, the server

    SHOULD assume that all languages are
    equally acceptable. If an
    Accept-Language header is present,
    then all languages which are assigned
    a quality factor greater than 0 are
    acceptable.

    It might be contrary to the privacy
    expectations of the user to send an
    Accept-Language header with the
    complete linguistic preferences of the
    user in every request. For a
    discussion of this issue, see section
    15.1.4.

    As intelligibility is highly dependent
    on the individual user, it is
    recommended that client applications
    make the choice of linguistic
    preference available to the user. If
    the choice is not made available, then
    the Accept-Language header field MUST
    NOT be given in the request.

      Note: When making the choice of linguistic preference available to
      the user, we remind implementors of  the fact that users are not
      familiar with the details of language matching as described above,
      and should provide appropriate guidance. As an example, users
      might assume that on selecting "en-gb", they will be served any
      kind of English document if British English is not available. A
      user agent might suggest in such a case to add "en" to get the
      best matching behavior.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a website that can be visited by type of browsing
hi all i want to know that we can store information and session information
I want to know what exactly is the sequence of calls that occurs when
I want to know which tool can be used to measure the cyclomatic complexity
I want to know if i can create a custom google maps application,on which
i want to know how to edit a single row (which i select) from
i want to know where user controls should be used and where custom control
I want to know the current input method the user is typing in such
If all tables I want to delete from have the column gamer_id can i
Want to know what the stackoverflow community feels about the various free and non-free

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.