Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. Home
    2. SEO Tactics
    3. On-Page Optimization
    4. 301 Redirects - Large .htaccess file question

    Moz Q&A is closed.

    After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

    301 Redirects - Large .htaccess file question

    On-Page Optimization
    3
    4
    1213
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • leadforms
      leadforms last edited by

      We are moving about 5000 pages from root into different folders. We need to individually 301 each page because the are sitting at root level now:

      mysite.com/page.com

      We want to move them to: mysite.com/folder/page.html etc

      I dont think redirect match can works because of the different files names and folders they are being moved in to.

      Will 5000 entries in .htacess slow site loading? Any other suggestions how to handle?

      rsneha 1 Reply Last reply Reply Quote 0
      • rsneha
        rsneha @leadforms last edited by

        @leadforms
        Try this format via your .htaccess

        # Enable Rewrite Engine
        RewriteEngine On
        RewriteBase /
        
        # Individual 301 Redirects
        Redirect 301 /page1.html /folder1/page1.html
        Redirect 301 /page2.html /folder2/page2.html
        Redirect 301 /page3.html /folder3/page3.html
        # ... (and so on for the other 4997 pages)
        
        # If there are other specific redirects unrelated to the pages being moved, you can add them here as well.
        
        

        I hope it helps you.

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

          Sorry I meant to add some links that might be useful.

          here they are

          https://moz.com/community/q/will-301-redirects-slow-page-speed

          https://moz.com/blog/heres-how-to-keep-301-redirects-from-ruining-your-seo

          https://moz.com/community/q/massive-301-permanant-redirects This is an older question on here but may have some useful insights.

          https://webmasters.stackexchange.com/questions/113246/does-too-many-301-redirects-harm-serp-rankings

          http://www.thesempost.com/best-practices-for-301s-in-large-htaccess-file/

          https://www.impactbnd.com/blog/301-redirect-lessons

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

            Hi Leadforms,

            Interesting question.

            Having lots of redirects will slow down your site.

            There are different ways to implement your redirects other than .htaccess but I believe this would be the best method for you.

            Is there any way you can group some of the redirects? maybe part of the URL is the same for all the pages you want to send to a certain folder then the match may work?

            If not then I think you have a massive job on to redirect 5k pages and manage the redirects afterwards as well.

            I would look at the pages and judge the value of a redirect on that page. If the page has no external links pointing to it and it has a low PA then do you need to redirect it?

            You also need to keep in mind a few other things:

            1. You need to make sure that the page you are redirecting to and from are similar in a boolean context - that is that a machine will see them as the same content and not just a person

            2. you need to avoid redirect chains - that is a redirect to a redirect and so on

            3. If you have redirects in place at the moment from HTTP to https you need to redirect these separately otherwise you will generate a chain

            4. I would amend all your internal links rather than relying on the redirect otherwise again you will create a chain

            Once you have implemented the redirects you will need to monitor them to see how much traffic they are generating, if after a few months a redirect is generating no traffic and all the traffic is going to the new URL then you will need to consider the benefit of keeping that redirect in place or removing it to improve site load times.

            I hope this helps,

            Steve

            MrWhippy 1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post

            Got a burning SEO question?

            Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


            Start my free trial


            Browse Questions

            Explore more categories

            • Moz Tools

              Chat with the community about the Moz tools.

            • SEO Tactics

              Discuss the SEO process with fellow marketers

            • Community

              Discuss industry events, jobs, and news!

            • Digital Marketing

              Chat about tactics outside of SEO

            • Research & Trends

              Dive into research and trends in the search industry.

            • Support

              Connect on product support and feature requests.

            • See all categories

            Related Questions

            • crichardson1992

              Should I redirect a popular but irrelevant blog post to the home page?

              Hi. I'm trying to get my website; www.ciphr.com , to rank for keywords relevant to "HR Software" in the UK.  It's a highly competitive industry and we rank ~mid to low on page one for some of our ideal keywords that are highly relevant and high volume. Years ago we took the decision to blog about topics more loosely related to the world of work. One of our blog posts, about plants in the office https://www.ciphr.com/advice/plants-in-the-office/   is popular. It gets decent traffic and consistently builds backlinks to the post without any further effort on our part. The specific page has a PA of 46 and DA of 55 with >500 domains linking to it.  This compares to our home page with a PA of 47 and 700 linking domains. It is typically the home page that ranks for our money keywords "HR Software" "HR Systems" in the UK. Because this blog post is so loosely related to our actual business, the traffic it generates is highly unlikely to  turn into a customer of ours. I am considering redirecting the blog post to the home page to pass link juice to the home page. The concern I have is that, based on the anchor text and contextual signals from linking pages, Google might then infer that our home page is less relevant for our money keywords and more relevant for "plants". Are my concerns unfounded? What are your thoughts? Should I redirect the blog post to the home page? Another internal page?  Keep the blog post live? Thanks

              On-Page Optimization | | crichardson1992
              2
            • Unbranded_Lee

              301 Redirect or landing page

              Hi everyone. I'm currently doing some SEO for a client, at the moment he has some landing pages which are categorised, but the category is set as a 302 redirect. I have a dilemma whether to 301 redirect to the landing page or make a page for each category. The link structure is as follows - http://examplesite.co.uk/products/fire/company-1/product/ so currently this is set as a 302 redirect - http://examplesite.co.uk/products/fire/company-1/ Do I make this page a category page and link the page to the children with some on-page optimisation or 301 redirect it?

              On-Page Optimization | | Unbranded_Lee
              0
            • markmiton

              Clickable Images Question

              This may seem like a minor issue but it is something that has been bothering me. When I write a blog post and place images within the text, is it better to have the image linking to nothing or link to the image url. I am guessing that unless I wish the image to rank for a certain keyword then it is not worth it linking to the image url. But would just like clarification if there is a more deep seated reason. Thanks Mark

              On-Page Optimization | | markmiton
              0
            • estebanseo

              Using keywords in my URL: Doing a redirect to /keyword

              My website in "On Page Grade" received an A.Anyway, I only have 1 thing to optimize:_"Use Keywords in your URL__Using your targeted keywords in the URL string adds relevancy to your page for search engine rankings, assists potential visitors identify the topic of your page from the URL, and provides SEO value when used as the anchor text of referring links."_My website is ranking in top10 for a super high competitive keyword and all my others competitors have the keyword on their domain, but not for my URL.Since I can't change my domain for fixing this suggestion, I would like to know what do you think about doing a 301 redirect from / to mydomainname.com/keyword/So the index of my website would be the /keyword.I don't know if this can make a damage to my SERP for the big change ir it would be a great choice.

              On-Page Optimization | | estebanseo
              0
            • Robotnik

              Using a dash or underscores in file names.

              Is it better to use a dash or an underscore in file names to improve SEO? EX memory_flash.jpg or memory-flash.jpg Or does it make no difference?

              On-Page Optimization | | Robotnik
              0
            • ScottMcPherson

              How long should I leave an existing web page up after a 301 redirect?

              I've been reading through a few of blog posts here on moz and can't seem to find the answer to these two questions: How long should I leave an existing page up after a 301 redirect? The page old page is no longer needed but has pretty high page authority. If I take the old page down—the one that I'm redirecting from—immediately after I set up the 301 redirect, will link juice still be passed to the new page? My second question is, right now, on my index.html page I have both a 301 redirect and a rel canonical tag in the head. They were both put in place to redirect and pass link equity respectively. I did this a couple years back after someone recommended that I do both just to be safe, but from what I've gathered reading the articles here on moz is that your supposed to pick one or the other depending on whether or not it's permanent. Should I remove the rel conanical tag or would it be better to just leave it be?

              On-Page Optimization | | ScottMcPherson
              0
            • SarahCollins

              SEO Location Pages - ALT Image Tag Question

              Hello Guru's, I have a Hire Website whereby you can rent products online. I have created different Location pages for these which are in essence the same pages  page but with different location specific urls, title tags  , on page content etc etc. This helps me to rank for local search. These location pages also display 20 products per page. My question is  Should I make the ALT IMAGE TEXT location specific for each of the 20 products  . Example -  Steam Cleaner Rental in "location" or should I only amend a few of the Atl Image Texts to be location specific. I don't want to come accross as spammy in google eyes but I also don't want to be seen as having duplicate content , images etc etc What do you think ? thanks Sarah.

              On-Page Optimization | | SarahCollins
              0
            • MeghanPrudencio

              Would it be bad to change the canonical URL to the most recent page that has duplicate content, or should we just 301 redirect to the new page?

              Is it bad to change the canonical URL in the tag, meaning does it lose it's stats? If we add a new page that may have duplicate content, but we want that page to be indexed over the older pages, should we just change the canonical page or redirect from the original canonical page? Thanks so much! -Amy

              On-Page Optimization | | MeghanPrudencio
              0

            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
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority 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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy

            Looks like your connection to Moz was lost, please wait while we try to reconnect.