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. Intermediate & Advanced SEO
    4. Www. & Non-www versions problem

    Www. & Non-www versions problem

    Intermediate & Advanced SEO
    5 2 201
    • 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.
    • NileCruises
      NileCruises last edited by

      I currently have both WWW and non-WWW versions of my site live on the web, and I want to be able to have all non-WWW to point to WWW.http://nile-cruises-4u.co.ukhttp://www.nile-cruises-4u.co.uk
      I want just the WWW version of the site live.I'm wondering the best way to resolve this?Is it normally dealt with in the .htaccess file and I think, looks like this but I'm not sure:

      <code>RewriteCond %{HTTP_HOST} !^www\.
      RewriteRule ^(.*)$ [http://www.](http://www.)%{HTTP_HOST}/$1 [R=301,L]</code> 
      
      1 Reply Last reply Reply Quote 0
      • SanketPatel
        SanketPatel last edited by

        Hi Nile,I have made code for you... please this code in .httaccess fileRewriteEngine onRewriteRule ^([A-Za-z0-9-]+)/?$ index.cfm?id=$1 [L]Rewritecond %{http_host} ^nile-cruises-4u.co.uk/$ [nc]rewriterule ^(.*)$ http://www.nile-cruises-4u.co.uk/$1 [r=301,nc] RewriteRule ^index.cfm http://www.nile-cruises-4u.co.uk/ [L,R=301]

        Hope this help you out.....

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

          Thank you very much Sanket.

          That's so kind of you.

          Colin

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

            Thanks to Sanket I've successfully managed to have the site show only www. and not the non-www. versions.

            However I have a blog on the site and that still shows the non-www. version, for example:

            http://nile-cruises-4u.co.uk/blog/makadi-palace-hotel-makadi-bay/

            I wonder if anyone has come upon the same problem and what the solution might be?

            Thanks,

            Colin

            SanketPatel 1 Reply Last reply Reply Quote 0
            • SanketPatel
              SanketPatel @NileCruises last edited by

              Hi Colin,

              Login to wordpress admin panel then go to setting -> General and in that change put

              WordPress Address (URL) = http://www.nile-cruises-4u.co.uk/  and

              Site Address (URL) = http://www.nile-cruises-4u.co.uk/

              Hope this helps you...

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • We are redirecting http and non www versions of our website. Should all versions http (non www version and www version) and https (non www version) should just have 1 redirect to the https www version?
                BlueprintMarketing
                BlueprintMarketing
                0
                8
                437

              • Checklist for moving a site from non-www to www?
                PenaltyHammer
                PenaltyHammer
                0
                2
                401

              • Links to www vs non-www
                toddmatthewca
                toddmatthewca
                0
                7
                387

              • Do I need to set Preferred domain when the non-www redirects to www version?
                Ideas-Money-Art
                Ideas-Money-Art
                0
                4
                1.8k

              • Redirecting non-www pages to www ones
                bilalyaqoob
                bilalyaqoob
                0
                8
                798

              • Magento Base Install 302 from non www to www , problems?
                Highland
                Highland
                0
                2
                456

              • Www or no www
                TakeshiYoung
                TakeshiYoung
                0
                5
                531

              • How to redirect www vs. non-www in IIS
                AlanMosley
                AlanMosley
                0
                5
                2.2k

              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