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. Rewrite rules from one domain to another one

    Rewrite rules from one domain to another one

    Technical SEO Issues
    3 2 190
    • 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.
    • bobrock4
      bobrock4 last edited by

      I have moved he site from a server to another one, changing the domain name. The page names are the same, so in every urls you will have only a differnce in the domain name not in the rest of url.

      I would like to use rewriterule in the htaccess file to tell to everyone, especially to search engines, that I have now new urls.

      I have found this code, but I'm not sure it could be the right one in my case

      RewriteEngine On
      RewriteRule ^(.+)$ http://nuovodominio/$1 [R=301]
      

      Thanks to anyone could help me. Ciao, bob

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

        Bobrock4

        First, you need to 301 url to url as a best practice. Second, you need to understand that the more difficult issue is you changed domain name and that may cause Google, etc. to take a little longer to credit the 301 (due to bad practices in the past). That said, there is a great resource on moz that considers whether you are on a LAMP stack or microsoft, etc.

        The link is in Learn SEO  and is better than just giving you a rewrite rule as it will allow you to comprehend what is happening and why.

        I hope you find this helpful.

        Robert

        bobrock4 1 Reply Last reply Reply Quote 1
        • bobrock4
          bobrock4 @RobertFisher last edited by

          Very helpful Robert. Thank you and ciao. Bob

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • How to replace a custom platform's homepage with another homepage from another platform domain?
            victor.celer
            victor.celer
            0
            2
            17

          • Why has google stopped showing one domain and switching to showing another that points to the same website?
            AlanMosley
            AlanMosley
            0
            4
            146

          • Using images from one domain on another?
            PatrickDelehanty
            PatrickDelehanty
            0
            4
            123

          • I have a sub domain that has live content on it but the root domain redirects to another URL. I know this is not great but what are the implications?
            mjsikorsky
            mjsikorsky
            0
            3
            96

          • Moving multiple domains into one domain
            TommyTan
            TommyTan
            0
            3
            108

          • Domain hacked and redirected to another domain
            Dantek
            Dantek
            0
            4
            119

          • Moving wordpress from one domain to another and phpmyadmin
            bobrock4
            bobrock4
            0
            5
            165

          • 301 redirect domain to page on another domain
            YNWA
            YNWA
            0
            2
            562

          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