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. Htaccess help... I moved my blog from a seperate domain to newdomain.com/blog

    Htaccess help... I moved my blog from a seperate domain to newdomain.com/blog

    Technical SEO Issues
    7 4 509
    • 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.
    • KristyO
      KristyO last edited by

      Hi,

      I need help with my htaccess file, I've been told.

      I moved a blog i had hosted somewhere else to a directory on my ecommerce site. I was told i would need to write something to go in the htaccess file so the sites would not become duplicate content, but I'm a novice and have no idea how to write that code.

      blog moved from www.whosyourmoondoggie.com to www.moondoggieinc.com/blog

      Please help, or direct me to the right tutorial 🙂

      Thanks!

      KristyO

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

        This should be close. No warranties!

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

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

          Hi Kristy, If that does not work call my office in the morning and ask for CRIS... I WILL INSTRUCT HIM TO HELP YOU..

          BEST,

          TOM

          972-382-3241

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

            Hi Kristy

            If you want to move old domain to the new domain you should do a 301 moved permanently redirect.

            RewriteEngine On

            RewriteBase /RewriteCond %{HTTP_HOST} !www.whosyourmoondoggie.com$ [NC]

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

            After adding this code search engines and users will be automatically redirected to the new domain and all information related to that domain will transfer in new domain. One of the biggest advantage is that your page rank, link juice will also transfer to new domain.  Your website can be accessed with www.domain.com and domain.com.  So you can easily  solve duplicate content error with this code.

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

              Thank you everyone!

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

                When I put in your code I get a 500 error? and if I put in JayD's code the site comes back up but there's not a visible redirect.

                I know this sounds sill but I'm putting this into the htaccess of the old domain correct?

                Should i be getting a 500 error or be seeing a visible redirect when i go to the address?

                Thanks KO

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

                  found this

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

                  and it worked, thank you guys for your help though!

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  • We switched the domain from www.blog.domain.com to domain.com/blog.
                    Nigel_Carr
                    Nigel_Carr
                    0
                    3
                    170

                  • How to redirect my .com/blog to my server folder /blog ?
                    AymanH
                    AymanH
                    0
                    5
                    149

                  • Domain Forwarding / Multiple Domain Names / or Rebuild Blogs on them
                    smarties954
                    smarties954
                    0
                    2
                    161

                  • Blog.domain.co.uk or domain.co.uk/blog
                    eyepaq
                    eyepaq
                    0
                    4
                    279

                  • Is it better for our Blog to be blog.domain.tld or domain.tld/blog ?
                    JustinTaylor88
                    JustinTaylor88
                    0
                    2
                    248

                  • Getting multiple errors for domain.com/xxxx/xxxx/feed/feed/feed/feed...
                    Brandtailers
                    Brandtailers
                    0
                    5
                    1.4k

                  • Redirecting blog.<mydomain>.com to www.<mydomain>.com\blog</mydomain></mydomain>
                    MarkWill
                    MarkWill
                    0
                    6
                    1.3k

                  • I have a site that has both http:// and https:// versions indexed, e.g. https://www.homepage.com/ and http://www.homepage.com/. How do I de-index the https// versions without losing the link juice that is going to the https://homepage.com/ pages?
                    fthead9
                    fthead9
                    0
                    3
                    729

                  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