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 for homepage with language code

    301 Redirect for homepage with language code

    Technical SEO Issues
    4 2 2.0k
    • 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.
    • kwoolf
      kwoolf last edited by

      In my multilingual Magento store, I want to redirect the hompage URL with an added language code to the base URL. For example, I want to redirect http://www.mysite.com/tw/ to http://www.mysite.com/ which has the exact same content.

      Using a canonical URL will help with search engines, but I would just rather nip the problem in the butt by not showing http://www.mysite.com/tw/ to visitors in the first place. Problem is that I don't want (can't have) all /tw/ removed from URLs due to Magento limitations, so I just want to know how to redirect this single URL. Since rewrites are on, adding Redirect 301 /tw http://www.88kbbq.com would redirect all URLs with the /tw/ language code to ones without. Not an option.

      Hope folks can lend a hand here.

      1 Reply Last reply Reply Quote 0
      • RyanKent
        RyanKent last edited by

        How are you adding the 301? Directly into .htaccess? or with tool such as the Redirect app in cPanel?

        I am not a htaccess expert but from my understanding there are two types of redirects related to your request: normal redirects, and wildcard redirects.

        A normal redirect would apply only to a single URL, the one you add.

        The behavior you are describing is a wildcard redirect. A wildcard redirect says to take any URLs which begin as http://www.88kbbq.com/tw and redirect them. That is the undesirable result you are trying to avoid.

        1 Reply Last reply Reply Quote 0
        • kwoolf
          kwoolf last edited by

          Note that the current site doesn't have the issue I'm asking about. We're working on a new site with IE6 support (tears) and better address support for Taiwan. I usually use .htaccess for redirects but am open to any solution. Yes, I'm try to avoid the wildcard redirect--I only need www.88kbbq.com/tw to redirect to www.88kbbq.com so both visitors and search engines will never see the former. Thanks for your response. Hope to find a solution soon!

          1 Reply Last reply Reply Quote 0
          • kwoolf
            kwoolf last edited by

            Ok, problem solved. The methodology in my question was apparently not the right approach. The structure should I had to set up a language folder /en/ and copy my index.php and .htaccess file to that location. Then I modified the index.php file to direct to the 'en' site and changed the base URL in the Magento backend to /en/. Also, I turned off 'add store code to URL'. Now my Taiwan visitors see http://www.88kbbq.com/ and visitors to the English site see http://www.88kbbq.com/en/. No redirects necessary.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • 301 Redirects Showing As 307 Redirects
              0
              1
              64

            • Redirect 302 status code to 301 status code
              rijwielcashencarry040
              rijwielcashencarry040
              0
              5
              145

            • Redirect a 301 Redirect
              RedCaffeine
              RedCaffeine
              0
              5
              98

            • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
              Chris-CA
              Chris-CA
              0
              5
              456

            • Is it better to delete web pages that I don't want anymore or should I 301 redirect all of the pages I delete to the homepage or another live page?
              EGOL
              EGOL
              0
              2
              417

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

            • Trailing slash 301 redirect code
              jamesjackson
              jamesjackson
              0
              10
              5.4k

            • 301 Redirection of entire section to the homepage
              KeriMorgret
              KeriMorgret
              0
              4
              741

            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