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 redirects and Dynamic URLs

    301 redirects and Dynamic URLs

    Technical SEO Issues
    3 2 1.1k
    • 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.
    • Barrycliff68
      Barrycliff68 last edited by

      I just ran my first diagnostic and one of my primary immediate problems are duplicate titles and duplicate content. My guess it that because the root URL http://sitename.com (which has not yet been redirected to www...) has generated an entire tree of content which is identical to the tree rooted at http://www.sitename.com.

      QUESTION:

      Do I need to do a redirect simply for the root url (sitename.com -> www.sitename.com) or do I now need to develop specific 301 redirects for each of the sub-nodes/pages?

      ie

      sitename.com/?q=about-us -> www.sitename.com/?q=about-us

      sitename.com/?q=our-team -> www.sitename.com/?q=our-team

      etc.

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

        Hi,

        I have never heard of doing a single redirect for each individual page to redirect non www to www (and not sure how one would do that, not sure it is possible as an infinite loop would be caused)

        but below is how to do it in both Apache .htaccess and IIS 7.0 using URLrewrite

        Apache = Must have rewrite_module modules/mod_rewrite.so

        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^example.com
        RewriteRule (.*) http://www.example.com/$1 [R=301,L]

        IIS= URL Rewrite http://blogs.msdn.com/b/carlosag/archive/2008/09/02/iis7urlrewriteseo.aspx<configuration> <system.webServer> <rewrite> <rules> <rule name="Redirect to WWW" stopProcessing="true"> <match url=".*" />
                  <conditions> <add input="{HTTP_HOST}" pattern="^example.com$" />
                  conditions> <action type="Redirect" url="http://www.example.com/{R:0}" redirectType="Permanent" />
                rule> rules> rewrite> system.webServer> configuration>hope this helps

        Barrycliff68 1 Reply Last reply Reply Quote 1
        • Barrycliff68
          Barrycliff68 @Jinx14678 last edited by

          Thanks for the help - my gut tells me that I shouldn't have to do it for every possible iteration that could be generated.

          So if I redirect the root url and Google has already indexed interior pages using the non-www url, will Google (et al) systematically revisit all the old links or start again at the root directory and have the (no longer) duplicate content just fall off the results pages and stop impacting my relevance?

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • 301 redirecting a previously abused URL
            Tenlo
            Tenlo
            0
            2
            35

          • Redirect URLS with 301 twice
            KeriMorgret
            KeriMorgret
            0
            5
            1.5k

          • Redirect a 301 Redirect
            RedCaffeine
            RedCaffeine
            0
            5
            98

          • 301: Dynamic URL to Static Page
            Aleyda
            Aleyda
            0
            7
            3.9k

          • 301 duplicate content dynamic url
            dashinfashion
            dashinfashion
            0
            9
            675

          • 301 Redirect Domain or 301 Redirect Domain + Interior Pages
            Room214
            Room214
            0
            7
            1.1k

          • Drupal URL Aliases vs 301 Redirects + Do URL Aliases create duplicates?
            YannickVeys
            YannickVeys
            0
            4
            2.5k

          • Trailing Slashes In Url use Canonical Url or 301 Redirect?
            RyanKent
            RyanKent
            0
            7
            2.7k

          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