The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. 301 redirect to 1 of 3 locations based on browser languge? Is this ok?

    301 redirect to 1 of 3 locations based on browser languge? Is this ok?

    Technical SEO Issues
    2 2 1.3k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • vheilman
      vheilman last edited by

      Hi all,

      I'm taking over a site that has some redirect issues that need addressed and I want to make sure this is done right the first time.

      The problem: Our current setup starts with us allowing both non-www and www pages. I'll address this with a proper rewrite so all pages will have www.

      Server info:  IIS and runs PHP.

      The real concern is that we currently run a browser detection for language at the root and then do a 302 redirect to /en, /ge or /fr. There is no page at the www.matchware.com. It's an immediate redirect to a language folder.

      I'd like to get these to a 301(Permanent) redirect but I'm not sure if a URL can have a 301 redirect that can go to 3 different locations.

      The site is huge and a site overhaul is not an option anytime soon.

      Our home page uses this:

      <%
      lang = Request.ServerVariables("HTTP_ACCEPT_LANGUAGE")
      real_lang = Left(lang,2)
      'Response.Write real_lang
      Select case real_lang
          case "en" 
              Response.Redirect "/en"
          case "fr"
              Response.Redirect "/fr"
          case "de"
              Response.Redirect "/ge"
          case else
              Response.Redirect "/en"

      End Select
      %>

      Here is a header response test.

      ++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      HTTP Request Header

      Connect to 87.54.60.174 on port 80 ... ok
      
      GET / HTTP/1.1[CRLF]
      Host: www.matchware.com[CRLF]
      Connection: close[CRLF]
      User-Agent: Web-sniffer/1.0.37 (+http://web-sniffer.net/)[CRLF]
      Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7[CRLF]
      Cache-Control: no-cache[CRLF]
      Accept-Language: de,en;q=0.7,en-us;q=0.3[CRLF]
      Referer: http://web-sniffer.net/[CRLF]
      [CRLF]
      
      

      HTTP Response Header

      --- --- ---
      Status: HTTP/1.1 302 Object moved
      Connection: close
      Date: Fri, 13 May 2011 14:28:30 GMT
      Server: Microsoft-IIS/6.0
      X-Powered-By: ASP.NET
      Location: /ge
      Content-Length: 124
      Content-Type: text/html
      Set-Cookie: ASPSESSIONIDQSRBQACT=HABMIHACEMGHEHLLNJPMNGFJ; path=/
      Cache-control: private

      Content (0.12 <acronym title="KibiByte = 1024 Byte">KiB</acronym>)

      <title></span>Object moved<span class="tag"></title>
       # Object Moved This object may be found  <a< span="">HREF="/ge">here.
      
      +++++++++++++++++++++++++++++++++++++++++++++++++++++
      
      To sum it up, I know a 302 is a bad option, but I don't know if 
      a 301 is a real option for us since it can be redirected to 1 of 3 
      pages?
      
      Any suggestions?</a<>
      
      1 Reply Last reply Reply Quote 1
      • AlanBleiweiss
        AlanBleiweiss last edited by

        If you feel you need to do this regardless of language, run a PHP if/then script looking for browser language.  Based on the language you can then set the 301 right in the script loop.

        Header( "HTTP/1.1 301 Moved Permanently" );
        Header( "Location: http://www.matchware.com/yourlanguagefolder/" );
        ?>

        My question though is why would you not have at least one language be the default, and have that at the root home level (www.matchware.com/)

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        • To 301 or not to 301?
          iHasco
          iHasco
          1
          4
          70

        • 301 Redirects
          TheeDigital
          TheeDigital
          0
          3
          258

        • 301 Redirect Attribute-Based Dynamic URL to Renamed Attributes
          MichaelC-15022
          MichaelC-15022
          0
          2
          175

        • Redirect a 301 Redirect
          RedCaffeine
          RedCaffeine
          0
          5
          98

        • 301 Redirect without specifying base domain?
          yacpro13
          yacpro13
          0
          4
          362

        • 301 Redirect for 3 Domains into 1 New Domain
          JaredMumford
          JaredMumford
          0
          3
          517

        • Google Webmaster redirect vs 301 redirect
          lavellester
          lavellester
          0
          2
          493

        • Level 1 Child Redirect to Level 3 (SEO)
          RyanKent
          RyanKent
          0
          4
          787

        Get started with Moz Pro!

        Unlock the power of advanced SEO tools and data-driven insights.

        Start my free trial
        Products
        • Moz Pro
        • Moz Local
        • Moz API
        • Moz Data
        • STAT
        • Product Updates
        Moz Solutions
        • SMB Solutions
        • Agency Solutions
        • Enterprise Solutions
        • Digital Marketers
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • Local Citation Checker
        • MozBar Extension
        • MozCast
        Resources
        • Blog
        • SEO Learning Center
        • Help Hub
        • Beginner's Guide to SEO
        • How-to Guides
        • Moz Academy
        • API Docs
        About Moz
        • About
        • Team
        • Careers
        • Contact
        Why Moz
        • Case Studies
        • Testimonials
        Get Involved
        • Become an Affiliate
        • MozCon
        • Webinars
        • Practical Marketer Series
        • MozPod
        Connect with us

        Contact the Help team

        Join our newsletter
        Moz logo
        © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy