Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

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

    1. Home
    2. SEO Tactics
    3. Technical SEO
    4. What is the best way to redirect visitors to certain pages of your site based on their location?

    Moz Q&A is closed.

    After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

    What is the best way to redirect visitors to certain pages of your site based on their location?

    Technical SEO
    4
    7
    1614
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • Firestarter-SEO
      Firestarter-SEO Subscriber last edited by

      One website I manage wants to redirect users to state specific pages based on their location. What is the best way to accomplish this?

      For example a user enters the through site.com but they are in Colorado so we want to direct them to site.com/colorado.

      1 Reply Last reply Reply Quote 0
      • N1ghteyes
        N1ghteyes @Firestarter-SEO last edited by

        Thats a good point actually, being UK based, i tend to forget States in the US is how you're likely to do location redirects (that and i read Colorado as Canada... my bad).

        The short answer i think is not directly. You could use the users IP address and something called mode_geoip in order to handle the redirects, it takes a bit more configuration and setup though.

        Im seeing lots about redirecting on country, not all that much on redirecting on state, but a good starting point is perhaps this Stackoverflow thread. It's probably something you'll need to ask a developer to do.

        http://stackoverflow.com/questions/9838344/how-to-redirect-domain-according-to-country-ip-address

        1 Reply Last reply Reply Quote 0
        • Firestarter-SEO
          Firestarter-SEO Subscriber @N1ghteyes last edited by

          Does cloudflare work on state level?

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

            There are a number of solutions, perhaps the easiest and best solution is to add Cloudflare to your site, and take a look at this blog:

            http://netjunky.net/redirect-web-traffic-based-on-country-origin/

            (this assumes your website runs on PHP)

            Firestarter-SEO 1 Reply Last reply Reply Quote 0
            • Firestarter-SEO
              Firestarter-SEO Subscriber last edited by

              Blitzna10, I agree that we should suggest a page rather than forward them to the page we "think" they should go to. However, I have been out voted ;(.

              If we have to forward users to a state specific page, what is the best method to do so? A 301, 302, JS redirect, Some other technology I am unaware of?

              Currently we are using a 302.

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

                Hi there

                Yes, based on the location and their IP, you can redirect users to the proper webpage they are supposed to see.

                I will reference a great answer from Dirk about this that you can read here. I learned a lot from this, as my answer in the thread is obviously wrong.

                Another source Dirk references is this blog post from Matt Cutts - check it out.

                Hope this all helps! Good luck!

                1 Reply Last reply Reply Quote 1
                • blitzna10
                  blitzna10 last edited by

                  I can't give you a technical answer. But, from what I understand, you are best off "suggesting" what page they should be redirected to, as opposed to automatically re-directing them. (but Ill stand corrected).

                  1 Reply Last reply Reply Quote 2
                  • 1 / 1
                  • First post
                    Last post

                  Got a burning SEO question?

                  Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


                  Start my free trial


                  Browse Questions

                  Explore more categories

                  • Moz Tools

                    Chat with the community about the Moz tools.

                  • SEO Tactics

                    Discuss the SEO process with fellow marketers

                  • Community

                    Discuss industry events, jobs, and news!

                  • Digital Marketing

                    Chat about tactics outside of SEO

                  • Research & Trends

                    Dive into research and trends in the search industry.

                  • Support

                    Connect on product support and feature requests.

                  • See all categories

                  Related Questions

                  • Smileworks_Liverpool

                    What's the best way for users to upload their images to my wordpress site to promote UGC

                    I have looked at lots of different plugins and wanted a recommendation for an easy way for patients of ours to upload pictures of them out partying and having fun and looking beautiful so future users can see the final results instead of sometimes gory or difficult to understand before and after images. I'd like to give them the opportunity to write captions (like facebook or insta posts and would offer them incentives to do so. I don't want it to be too complicated for them or have too many steps or barriers but I do want it to look nice and slick and modern. Also do you think this would have a positive impact on SEO? I was also thinking of a Q&A app where dentists could get Q&A emails and respond - i've been doing AMA sessions and they've been really successful and I would like to bring it into out site and make it native. Thanks in advance 🙂

                    Technical SEO | | Smileworks_Liverpool
                    1
                  • Jcoley

                    Sudden jump in the number of 302 redirects on my Squarespace Site

                    My Squarespace site www.thephysiocompany.com has seen a sudden jump in 302 redirects in the past 30 days. Gone from 0-302 (ironically). They are not detectable using generic link redirect testing sites and Squarespace have not explanation. Any help would be appreciated.

                    Technical SEO | | Jcoley
                    0
                  • Silviu

                    Removing a large number of unnecessary pages from a site

                    Hi all, I got a big problem with my website. I have a lot of page, duplicate page made from various combinations of selects, and for all this duplicate content we've be hit by a panda update 2 years ago. I don't want to bring new content an all of these pages, about 3.000.000, because most of them are unnecessary. Google indexed all of them (3.000.000), and I want to redirect the pages that I don't need anymore to the most important ones. My question, is there any problem in how google will see this change, because after this it will remain only 5000-6000 relevant pages?

                    Technical SEO | | Silviu
                    0
                  • Natitude

                    Best Practice on 301 Redirect - Images

                    We have two sites that sell the same products. We have decided to retire one of the sites as we'd like to focus on one property. I know best practice is to redirect apples to apples, which in our case is easily done since the sites sold the same thing. www.SiteABC.com/ProductA can be redirected to www.SiteXYZ.com/ProductA. My question is how far does that thinking go regarding images? Each product has a main product page, of course, and then up to 6 images in some cases. Is it necessary to redirect www.SiteABC.com/ProductA-Image1.jpg to www.SiteXYZ.com/ProductA-Image1.jpg? Or can they all be redirected to just the product page?

                    Technical SEO | | Natitude
                    0
                  • koamit

                    What should be use 301 or 302 redirection for 404 pages

                    Please suggest which redirection we should use for 404 pages- 301 or 302. If you can elaborate it with reason then it will be highly appreciated.

                    Technical SEO | | koamit
                    0
                  • Trigun

                    How to Redirect all inactive Feed to a specific Wordpress page

                    Hi Guys, I've been doing much cleaning on my blog lately and deleted numerous categories including their posts with low quality content. After deleting the categories, Google Webmaster Tools is reporting some 404 errors about the RSS Feeds for the deleted categories. I've created a 404.php file inside my theme and placed the following code header("HTTP/1.1 301 Moved Permanently");
                    header("Location: http://www.mysite.com/My404Page/", true, 301);
                    exit();
                    ?> this have catched all 404 errors and redirected them to the specific page. Unfortunately, it could not catch the inactive feed urls.  Is there a way to do this so that all inactive feeds will be redirected to my 404 page? Thanks in advance....

                    Technical SEO | | Trigun
                    0
                  • Donaab

                    How best to redirect URL from expired classified ads?

                    We have problem because our content are classifieds. Every ad expired after one or two mounts and then ad becomes inactive and we keep his page for one mount latter like a same page but we ad a notice that ad is inactive. After that we delete the ad and his page but need to redirect that URL to search results page which contains similar ads because we don't want to lose the traffic form that pages. How is the best way to redirect ad URL? Our thinking was to redirect internal without 301 redirection because the httacces file will be very big after a while  and we are thinking to try a canonicalization because we don't want engine to think that we have to much duplicate content.

                    Technical SEO | | Donaab
                    0
                  • askthetrainer

                    How to Redirect only specific pages to new domain

                    My HTACCESS FILE IS AS FOLLOWS: rewriteengine on
                    rewritecond %{HTTP_HOST} ^mydomain.com$
                    rewriterule ^mydomain/(.*)$ "http://www.mydomain.com/$1" [R=301,L] #4d864805b49b5 I want to move ONLY specific pages from this domain to a new domain How do I edit my HTACCESS (which redirects http:// to www.) to move specific pages from old domain (which I have to delete) to new domain.... I.e. http://mydomaon.com/move.html needs to move to http://mynewdomain.com/move.html Where i can delete the original domains

                    Technical SEO | | askthetrainer
                    0

                  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
                  Free SEO Tools
                  • Domain Authority Checker
                  • Link Explorer
                  • Keyword Explorer
                  • Competitive Research
                  • Brand Authority 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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
                  • Accessibility
                  • Terms of Use
                  • Privacy

                  Looks like your connection to Moz was lost, please wait while we try to reconnect.