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. We have set up 301 redirects for pages from an old domain, but they aren't working and we are having duplicate content problems - Can you help?

    We have set up 301 redirects for pages from an old domain, but they aren't working and we are having duplicate content problems - Can you help?

    Technical SEO Issues
    12 3 2.6k
    • 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.
    • danatanseo
      danatanseo last edited by

      We have several old domains. One is http://www.ccisound.com  - Our "real" site is http://www.ccisolutions.com  The 301 redirect from the old domain to the new domain works. However, the 301-redirects for interior pages, like:

      http://www.ccisolund.com/StoreFront/category/cd-duplicators  do not work. This URL should redirect to http://www.ccisolutions.com/StoreFront/category/cd-duplicators  but as you can see it does not.

      Our IT director supplied me with this code from the HT Access file in hopes that someone can help point us in the right direction and suggest how we might fix the problem:

      RewriteCond%{HTTP_HOST} ccisound.com$ [NC]

      RewriteRule^(.*)$ http://www.ccisolutions.com/$1 [R=301,L]

      Any ideas on why the 301 redirect isn't happening? Thanks all!

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

        Hi,

        The supplied url for interior page of old domain which you have mentioned not redirecting seems not correct. Because you have linked that text with the new domain. Anyway I have understand your problem. Your problem is

        http://www.ccisound.com

        is redirecting to

        http://www.ccisolutions.com

        but

        http://www.ccisound.com/StoreFront/category/cd-duplicators

        is not redirecting to

        http://www.ccisolutions.com/StoreFront/category/cd-duplicators

        If I have understood correctly, the solution for your problem is, Do a wildcard 301 redirection. It will redirects all the inner pages to the new domain's inner pages. But all the inner pages in new site, must have the same paths as the old site. Hope you understand what I mean.

        Anyway when look in to the example urls you have provided it seems both sites have the same content. So there is nothing to worry about. Seems you have just changed domain name.

        So anyway use the following code in your .htaccess file inside your root folder

        RewriteEngine on

        Options +FollowSymLinks

        RewriteCond %{HTTP_HOST} ^ccisound.com$ [OR]
        RewriteCond %{HTTP_HOST} ^www.ccisound.com$
        RewriteRule ^(.*)$ "http://www.ccisolutions.com/$1" [R=301,L]

        First and second line do not write again if those already written inside your .htaccess file.

        the above code will initiate a wildcard 301 redirection and will solve your problem. Hope you can improve the code for all the other domains you have. Otherwise post here. I will do it for you.

        Regards

        Prasad

        danatanseo 1 Reply Last reply Reply Quote 1
        • ersaky
          ersaky last edited by

          This post is deleted!
          danatanseo 1 Reply Last reply Reply Quote 1
          • danatanseo
            danatanseo @cprasad last edited by

            Yes, a catch-all makes sense to me. what is the difference between your code suggestion and the one just below posted by Ersin A. ? Also, just for our own understanding, can you explain why the code we were using wasn't accomplishing what we wanted? (I just want to be able to explain it to our Web team). Thanks!

            cprasad 1 Reply Last reply Reply Quote 0
            • danatanseo
              danatanseo @ersaky last edited by

              Thanks Ersin,

              Can you explain how your coding suggestion is different from Prasad's? I am not a coder so am just wondering if there's a different methodology behind the two suggestions?

              ersaky danatanseo 2 Replies Last reply Reply Quote 0
              • cprasad
                cprasad @danatanseo last edited by

                Hi,

                Do not worry about the differences about the code provided by me and by Ersin. Both are same in functioning. He have just added module activation tags in to the code. So you may use any code which you prefer and works for you.

                And the answer for your question about the code you were using, it may not be initiate a wildcard redirection.

                Are there more codes inside the .htaccess?

                If you can post the exact code without hyper-linking any url then I can tell you the exact reason why your code does not do the job.

                Prasad

                1 Reply Last reply Reply Quote 0
                • ersaky
                  ersaky @danatanseo last edited by

                  cprasad's and my purpose are same, so our responses will work. But just some diffrences;

                  "<ifmodule mod_rewrite.c="">" line checks wheter Apache's rewrite module is activated or not. If it is then it runs the code after that. The second one is that my rewritecond lines are less than cprasad's, but they all same conditions.By the way, i have just tested it before I wrote it.</ifmodule>

                  Just do it..

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

                    Thanks to both Ersin and Prasad. I appreciate your efforts to help very much. My IT director tried both versions of code without success. Here is exactly what he wrote:

                    " I tried the suggestions without success. I even moved the ccisound
                    redirects to the top of the file thinking that some other redirect was grabbing
                    it first, But no go, same results. Top level redirected, lower level not."

                    Any suggestions as to why neither code succeeded at creating a "catch all." ?

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

                      Hi,

                      I think you are doing so many mistakes. First take out all the other codes from your .htaccess file. Then copy only one code from me or from Ersin. While you have some other codes related to this domains redirection there may have conflicts. And your current code work for your root domains mean your .htaccess redirection is working. The problem is you have not used it correctly.

                      danatanseo 2 Replies Last reply Reply Quote 1
                      • danatanseo
                        danatanseo @cprasad last edited by

                        Thanks Prasad,

                        We tried your suggestion because there was a lot of stuff [1220 lines of code] in our .htaccess file. We stripped everything out except your code, and still had the same problem. Our IT director is wondering if perhaps there is a conflict between the .htaccess file that operates at the Apache level and the URL rewirte file which operates at the TomCat level. He is wondering, does one of them take precedence over the other? In other words, could our URL re-write file be causing the redirects in the .htaccess file to not work properly?

                        I am thinking maybe we need to hire someone to look at the code in both files in order to figure out where and why we are having a conflict?

                        Dana

                        cprasad 1 Reply Last reply Reply Quote 0
                        • danatanseo
                          danatanseo @cprasad last edited by

                          Thanks Prasad for all your help. And thank you to Ersin also. We have solved the problem. Apparently, our URL re-write at the TomCat level was taking precedence over the .htaccess file. Once our IT director added the appropriate redirect for these domain pages into the URL re-write file, the problem was fixed and those pages now render with a 301-redirect to the correct page one the correct domain. I have encouraged him to write a blog post about this and put it here because there was very little documentation online about TomCat redirects tasking precedence over an .htaccess file.

                          1 Reply Last reply Reply Quote 0
                          • cprasad
                            cprasad @danatanseo last edited by

                            Yes, That is the best thing you can do. Because seems there have some other issues in configs. And we can not see from here about your all the configs. Anyway the codes we have given you will successfully work once you solve your other problems.

                            Best Regards

                            Prasad

                            1 Reply Last reply Reply Quote 1
                            • 1 / 1
                            • First post
                              Last post
                            • I need help with redirecting chain to another page and 301, I don't understand on how to fix
                              salem4e
                              salem4e
                              0
                              3
                              111

                            • Should I 301 Redirect Deindexed Pages of an Old Domain
                              PatrickDelehanty
                              PatrickDelehanty
                              0
                              3
                              259

                            • Getting high priority issue for our xxx.com and xxx.com/home as duplicate pages and duplicate page titles can't seem to find anything that needs to be corrected, what might I be missing?
                              Todd_McDonald
                              Todd_McDonald
                              0
                              4
                              4.0k

                            • 301 redirects don't work properly
                              Kapottefietsband
                              Kapottefietsband
                              0
                              3
                              91

                            • Why can't I redirect 302 errors to 301's?
                              Chris.Menke
                              Chris.Menke
                              0
                              3
                              80

                            • Duplicate Page Content error but I can't see it
                              KateWaite85
                              KateWaite85
                              0
                              5
                              237

                            • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
                              Chris-CA
                              Chris-CA
                              0
                              5
                              456

                            • According to 1 of my PRO campaigns - I have 250+ pages with Duplicate Content - Could my empty 'tag' pages be to blame?
                              ninjaprecision
                              ninjaprecision
                              0
                              2
                              247

                            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