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. Intermediate & Advanced SEO
    4. Worpress Redirect

    Worpress Redirect

    Intermediate & Advanced SEO
    3 2 78
    • 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.
    • SCW
      SCW last edited by

      I am migrating a WP site from one domain to another for a client. WP is installed at the root.

      Typically I would simply issue a 301-redirect for the entire domain, however, in this case, the client wants the content in 2 specific subfolders to remain live on the old site and have everything else redirected. Example:

      olddomain.com/subfolder-1/

      olddomain.com/subfolder-2/

      Question: what would the the htaccess code look like to pull this off?

      Thanks!

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

        Try this -

        RewriteEngine on
        RewriteCond %{REQUEST_URI}!^/subfolder-1/
        RewriteCond %{REQUEST_URI}!^/subfolder-2/
        RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

        SCW 1 Reply Last reply Reply Quote 1
        • SCW
          SCW @StreamlineMetrics last edited by

          That looks like it should do the trick.

          Thank you!

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Would You Redirect a Page if the Parent Page was Redirected?
            Nozzle
            Nozzle
            0
            4
            92

          • Should I do a redirect
            0
            1
            33

          • Redirect Plugin: Redirecting or Rewriting?
            HashtagHustler
            HashtagHustler
            0
            3
            230

          • 301 Redirects... Redirect all content at once or in increments?
            Koki.Mourao
            Koki.Mourao
            0
            6
            175

          • To redirect or not to redirect, that is the question
            CommT
            CommT
            0
            5
            126

          • To Redirect or Not
            HashtagHustler
            HashtagHustler
            0
            9
            144

          • How to use a 301 Redirect when the first 301 Redirect is not the same as what's indexed?
            PatriotOutfitters81
            PatriotOutfitters81
            0
            3
            66

          • Duplicate titles but redirecting anyway (without redirects set up!!!)
            JGar-28032
            JGar-28032
            1
            2
            348

          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