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 redirect from dynamic url to static page
            alstam
            alstam
            0
            3
            297

          • 301 Redirects, Sitemaps and Indexing - How to hide redirected urls from search engines?
            LoganRay
            LoganRay
            0
            4
            3.0k

          • 301 redirects - one overall redirect or an individual one for each page url
            Kurt_Steinbrueck
            Kurt_Steinbrueck
            1
            4
            160

          • Should I make a new URL just so it can include a target keyword, then 301 redirect the old URL?
            Kurt_Steinbrueck
            Kurt_Steinbrueck
            0
            5
            153

          • 301 duplicate content dynamic url
            dashinfashion
            dashinfashion
            0
            9
            675

          • 301 Redirecting weird URLs with % in them
            Jinx14678
            Jinx14678
            0
            4
            989

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

          • Not sure which URL to use for 301 redirect
            CeCeBar
            CeCeBar
            0
            7
            435

          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