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. SEO and Digital Marketing Forum
    2. Categories
    3. Community
    4. Industry News
    5. Industry Events
    6. How to redirect www.xxx.com to xxx.com or vice versa
    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.

    How to redirect www.xxx.com to xxx.com or vice versa

    Industry Events
    11 6 102.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.
    • healers
      healers last edited by

      Roger has detected a problem:  We have detected that the domain www.xxx.com and the domain xxx.com both respond to web requests and do not redirect. Having two "twin" domains that both resolve forces them to battle for SERP positions, making your SEO efforts less effective. We suggest redirecting one, then entering the other here.

      hi, i tried creating the campaign and this message popped out.. i dono what to do or how to redirect b/w www.xxx.com and xxx.com ( xxx = hidden site) am using godaddy domain and hosting at hostgator.

      thank you.. waiting for ur reply

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

        OK - just a REFRESH problem!

        I canceled the campaign creation and started from scratch again. And this time I had no error message.

        Thanks everyone!

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

          Hi everyone, I had the same problem and found this wonderful thread! Thanks a lot! Now, if I check the header of http://domain.com with the tool you suggested, I get the correct message:

          HTTP/1.1 301 Moved Permanently Date: Sat, 22 Oct 2011 09:13:19 GMT Server: Apache Location: http://www.domain.com/ Content-Type: text/html; charset=iso-8859-1

          However, when I try to continue with the campaign creation on SEOmoz, I stille get the same message as I did before. Is there a way to fix this? Am I doing something wrong? Here is my .htaccess:

          ptions +FollowSymlinks

          RewriteEngine On

          RewriteBase /

          RewriteRule ^index.html?$ / [NC,R,L]

          rewritecond %{http_host} ^domain.com [nc]

          rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

          Thanks for your help! I hope you can guide me to sort things out!

          1 Reply Last reply Reply Quote 0
          • healers
            healers @KeriMorgret last edited by

            yes it works.. thanks keri 🙂

            1 Reply Last reply Reply Quote 0
            • KeriMorgret
              KeriMorgret @KeriMorgret last edited by

              Yes, the 301 response is what you're looking for. Test a couple of your interior pages in addition to just your home page to make sure it works right, then you're good to go!

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

                Here's how I do it in .htaccess in Linux:

                RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule .* http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

                If you already have a RewriteEngine in your .htaccess, you can skip that part.

                What this does is check if the host contains www.  If it doesn't it redirects to www. version.  You can find more info here: http://www.stevefortuna.com/redirect-to-www/

                1 Reply Last reply Reply Quote 1
                • healers
                  healers @KeriMorgret last edited by

                  1. Requesting: http://xxx.com

                  <dl>

                  <dt>server Response:</dt>

                  <dd>HTTP/1.1 301 Moved Permanently Date: Wed, 06 Jul 2011 11:42:26 GMT Server: Apache mod_fcgid/2.3.6 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 Location: http://www.xxx.com/ Cache-Control: max-age=3600 Expires: Wed, 06 Jul 2011 12:42:26 GMT Vary: Accept-Encoding Content-Type: text/html; charset=iso-8859-1
                  </dd>

                  <dd>I got this.. is this right?
                  </dd>

                  </dl>

                  1 Reply Last reply Reply Quote 0
                  • 3Amigos
                    3Amigos last edited by

                    This is a useful link for you:

                    http://www.webconfs.com/how-to-redirect-a-webpage.php

                    Best,

                    C

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

                      There are few safe ways you can re-direct your domain from non-www to www, they include:

                      • having a small code in your .htaccess if you are running linux

                      • in your header, you can specify where to redirect your site

                      We need to know the sort of platform your site is running on i.e. Windows; Linux as well as the platform or scripting language you are using i.e. asp; .NET or php

                      Also make sure in your webmaster tools to allow Google to know which one to use, so in your webmaster tools specify you want to use the www or non-www

                      Hope this helps, if you need more advice or help let me know

                      1 Reply Last reply Reply Quote 0
                      • KeriMorgret
                        KeriMorgret @healers last edited by

                        To see if you did it correctly, put in the non-www domain into a server header checker like http://www.seoconsultants.com/tools/check-server-headers-tool/ and see if it uses a 301 redirect to redirect to the www domain (or vice versa, if you set it to remove the www).

                        If that didn't work, we're happy to help walk you through doing this! What we'll need from you is a little more information about your server. Specifically, if you're using IIS or Apache, and if you're using a content management system. That will help us give you the right info if you still need help.

                        healers KeriMorgret 3 Replies Last reply Reply Quote 2
                        • healers
                          healers last edited by

                          i think i did it... 🙂

                          KeriMorgret 1 Reply Last reply Reply Quote 0
                          • 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


                          Explore more categories

                          • Moz Tools

                            Chat with the community about the Moz tools.

                            Getting Started
                            Moz Pro
                            Moz Local
                            Moz Bar
                            API
                            What's New

                          • SEO Tactics

                            Discuss the SEO process with fellow marketers

                            Content Development
                            Competitive Research
                            Keyword Research
                            Link Building
                            On-Page Optimization
                            Technical SEO
                            Reporting & Analytics
                            Intermediate & Advanced SEO
                            Image & Video Optimization
                            International SEO
                            Local SEO

                          • Community

                            Discuss industry events, jobs, and news!

                            Moz Blog
                            Moz News
                            Industry News
                            Jobs and Opportunities
                            SEO Learn Center
                            Whiteboard Friday

                          • Digital Marketing

                            Chat about tactics outside of SEO

                            Affiliate Marketing
                            Branding
                            Conversion Rate Optimization
                            Web Design
                            Paid Search Marketing
                            Social Media

                          • Research & Trends

                            Dive into research and trends in the search industry.

                            SERP Trends
                            Search Behavior
                            Algorithm Updates
                            White Hat / Black Hat SEO
                            Other SEO Tools

                          • Support

                            Connect on product support and feature requests.

                            Product Support
                            Feature Requests
                            Participate in User Research

                          • See all categories

                          • Attending MozCon 2015 and Interested in Connecting with Marketing Professionals
                            jonathanboatwright
                            jonathanboatwright
                            2
                            2
                            890

                          • How to increase pageviews for a news website when all the most common SEO strategies were already used, and they´ve reached a plateau of visits?
                            Kenaum
                            Kenaum
                            1
                            6
                            5.9k

                          • Going to Mozcon - what to do in Seattle
                            Andy-Halliday
                            Andy-Halliday
                            2
                            17
                            2.6k

                          • Is It Possible To Use Multiple Promotional Codes for Google AdWords?
                            DR70095
                            DR70095
                            0
                            3
                            4.9k

                          • [UPDATED] Any Q&A Regulars Attending MozCon Next Week?
                            ThompsonPaul
                            ThompsonPaul
                            1
                            11
                            1.9k

                          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

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