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 921677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:54:18+00:00 2026-05-15T18:54:18+00:00

I have a website that has multiple languages. The way this is set up

  • 0

I have a website that has multiple languages. The way this is set up now is that it looks at the http accept language and redirect the user to the specific language, or uses a default language when none is found.

The problem that I am facing is that web crawlers can’t index the root page, because it gives a 302 redirect. http://www.mydomain.com gets redirected to http://www.mydomain.com/nl/

The only way the website can be indexed is if I supply a sitemap for the whole website, including the languages. I have done that but I have not seen any indexed pages for weeks now.

So my question is: Will it be better to just have the website work in a default language.

To have the website in your own language you have to select the language when you are in the root website itself.

  • 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-15T18:54:18+00:00Added an answer on May 15, 2026 at 6:54 pm

    The problem that I am facing is that web crawlers can’t index the root page

    I haven’t seen this problem before. Webcrawlers certainly follows 302 redirects. Any chance that you’re (unawarely) blocking visitors without an Accept-Language header like webcrawlers?

    So my question is: Will it be better to just have the website work in a default language. To have the website in your own language you have to select the language when you are in the root website itself.

    I’d rather prefer the Accept-Language header and display the language which has the closest match with the in the header specified language(s) as per the HTTP 1.1 Specification. If none is specified, I’d display English as default language or at least the language which has the biggest coverage among the (expected) website audience.


    I see in your question history that you’re a PHP developer, so here’s an useful snippet to determine the closest match based on the Accept-Language header as per the HTTP 1.1 specification:

    function get_language($available_languages, $preferred_language = 'auto') {
        preg_match_all('/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?(\s*;\s*q\s*=\s*(1\.0{0,3}|0\.\d{0,3}))?\s*(,|$)/i', 
            $preferred_language == 'auto' ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : $preferred_language, $languages, PREG_SET_ORDER);
    
        $preferred_language = $available_languages[0]; // Set default for the case no match is found.
        $best_qvalue = 0;
    
        foreach ($languages as $language_items) {
            $language_prefix = strtolower($language_items[1]);
            $language = $language_prefix . (!empty($language_items[3]) ? '-' . strtolower($language_items[3]) : '');
            $qvalue = !empty($language_items[5]) ? floatval($language_items[5]) : 1.0;
    
            if (in_array($language, $available_languages) && ($qvalue > $best_qvalue)) {
                $preferred_language = $language;
                $best_qvalue = $qvalue;
            } else if (in_array($language_prefix, $available_languages) && (($qvalue*0.9) > $best_qvalue)) {
                $preferred_language = $language_prefix;
                $best_qvalue = $qvalue * 0.9;
            }
        }
    
        return $preferred_language;
    }
    

    (the above is actually a rewrite/finetune of an example found somewhere at php.net)

    It can be used as follows:

    $available_languages = array(
        'en' => 'English',
        'de' => 'Deutsch',
        'nl' => 'Nederlands'
    );
    
    $requested_language = get_it_somehow_from_URL() ?: 'auto';
    $current_language = get_language(array_keys($languages), $requested_language);
    
    if ($requested_language != $current_language) {
        // Unknown language.
        header('Location: /' . $current_language . '/' . $requested_page);
        exit;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this website http://wedessertmore.com that has some forms popup when you click on
I have a set of data in a website table that has multiple pages
I have a website that has a relative path to a stylesheet that looks
I'm developing a website that has some audio courses, each course can have multiple
I'm developing a website that has some audio courses, each course can have multiple
I an writing a website that will have multiple skins. Each skin has its
I have an asp.net website that has a master page and multiple normal pages.
So basically I have website that has names of cities that can be checked
I have a website that has highly granulised access and hence requires many web.config
I have a website that has one database I have also Desktop apps that

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.