undefined
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.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • 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.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    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
1.2k
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 May 13, 2019, 1:51 PM

    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 Jul 28, 2023, 11:32 AM Reply Quote 0
    • rsneha
      rsneha @leadforms last edited by Jul 28, 2023, 11:32 AM

      @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
      • topic:timeago_earlier,4 years
      • MrWhippy
        MrWhippy @MrWhippy last edited by May 14, 2019, 7:44 AM May 14, 2019, 7:44 AM

        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 May 14, 2019, 7:39 AM May 14, 2019, 7:39 AM

          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 May 14, 2019, 7:44 AM Reply Quote 1
          • 1 / 1
          1 out of 4
          • First post
            1/4
            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

          • hans-keeren

            What is the safest way to redirect for best SEO benefits?

            redirecting domain 301 redirect seo tactic

            What is the safest way to redirect for best SEO benefits? Example: loodgieter-aanhuis.nl -> loodgieters-ambacht.nl Does someone have any technical information on how to (root) redirect for best SEO practices?

            On-Page Optimization | May 3, 2023, 12:36 PM | hans-keeren
            0
          • baystatemarketing

            My site auto redirects http to https. This is causing redirect chains. What can I do?

            I noticed that Moz flags a lot of redirect chain issues on my site. I realized that this is mostly because the site automatically redirects http to https, and when I create a new URL (when a URL changes, for example) it is automatically flagged as a chain. Example: http://www.example-link Auto directs to: https://www.example-link Which is then redirected to: https://www.example-link-changed (when the address actually changes) I don't seem to have any control over changing where the initial http redirect goes. Any advice on fixing this problem?

            On-Page Optimization | Dec 28, 2019, 7:05 AM | baystatemarketing
            0
          • CopBlaster.com

            Will Google Count Links Loaded from JavaScript Files After the Page Loads

            Hi, I have a simple question. If I want to put an image with a link to another site like a banner ad on my page, but do not want it counted by Google. Can I simply load the link and banner using jQuery onload from a separate .js file? The ideal result would be for Google to index a script tag instead of a link.

            On-Page Optimization | Aug 13, 2019, 10:09 PM | CopBlaster.com
            1
          • SneakerFiles

            SERP Hijacking/Content Theft/ 302 Redirect?

            Sorry for the second post, thought this should have it's own. Here is the problem I am facing amongst many others. Let's take the search term "Air Jordan Release Dates 2017" and place it into Google Search.  Here is a link:
            https://www.google.com/#q=air+jordan+release+dates+2017 Towards the bottom of the page, you will see a website that has SneakerFiles (my website) in the title.  The exact title is: Air Jordan Release Dates 2016, 2017 | SneakerFiles - Osce Now, this is my content, but not my website. For some reason, Google thinks this is my site. If you click on the link in search, it automatically redirects you to another page (maybe 302 redirect), but in the cache you can see it's mine:
            http://webcache.googleusercontent.com/search?q=cache:qrVEUDE1t48J:www.osce.gob.pe/take_p_firm.asp%3F+&cd=8&hl=en&ct=clnk&gl=us I have blocked the websites IP, disallowed my style.css to be used so it just shows a links without the style, still nothing. I have submitted multiple google spam reports as well as feedback from search.  At times, my page will return to the search but it gets replaced by this website. I even filed a DMCA with Google, they declined it. I reached out to their Host and Domain register multiple times, never got a response. The sad part about this, it's happening for other keywords, for example if you search "KD 9 Colorways", the first result is for my website but on another domain name (my website does rank 3rd for a different Tag page). The page I worked hard on keeping up to date. I did notice this bit of javascript from the cloaked/hacked/serp hijacking website: I disabled iFrames...(think this helps) so not sure how they are doing this. Any help would be greatly appreciated. Note: I am using Wordpress if that means anything.

            On-Page Optimization | Aug 16, 2016, 3:09 AM | SneakerFiles
            0
          • mrdavidingram

            SVG image files causing multiple title tags on page - SEO issue?

            Does anyone have any experience with SVG image files and on-page SEO? A client is using them and it seems they use the title tag in the same way a regular image (JPG/PNG) would use an image ALT tag. I'm concerned that search engines will see the multiple title tags on the page and that this will cause SEO issues. Regular crawlers like Moz flag it as a second title tag, however it's outside the header and in a SVG wrap so the crawlers really should understand that this is a SVG title rather than a second page title. But is this the case? If anyone has experience with this, I'd love to hear about it.

            On-Page Optimization | Sep 8, 2016, 11:56 AM | mrdavidingram
            2
          • Taiger

            How can I fix multiple 404 errors with Wildcard htaccess redirect

            Hi all I hope that someone can help.... How can I fix multiple 404 errors with Wildcard htaccess redirect The url in question is: How can I fix multiple 404 errors with Wildcard htaccess redirect http://www.5starweddingdirectory.com/listing/search/Category/luxury_hotels_venues_uk_wedding_venues/exclusive_use_venues/letter/c http://www.5starweddingdirectory.com/listing/location/uk-england/bedfordshire-weddings/franklin-park http://www.5starweddingdirectory.com/deal/location/uk-england/chorley-weddings/curtis-bay etc, going to http://www.5starweddingdirectory.com/business the above is just a few examples, google webmaster is showing over  8.000 404 page not found errors. Thanks in advance.

            On-Page Optimization | Nov 18, 2014, 8:15 PM | Taiger
            0
          • jcgoodrich

            What is the best way to execute a geo redirect?

            Based on what I've read, it seems like everyone agrees an IP-based, server side redirect is fine for SEO if you have content that is "geo" in nature. What I don't understand is how to actually do this. It seems like after a bit of research there are 3 options: You can do a 301 which it seems like most sites do, but that basically means if google crawls you in different US areas (which it may or may not) it essentially thinks you have multiple homepages. Does google only crawl from SF-based IPs? 302 passes no juice, so probably don't want to do that. Yelp does a 303 redirect, which it seems like nobody else does, but Yelp is obviously very SEO-savvy. Is this perhaps a better way that solves for the above issues? Thoughts on what is best approach here?

            On-Page Optimization | Oct 31, 2013, 6:57 PM | jcgoodrich
            0
          • CMC-SD

            How much juice do you lose in a 301 redirect?

            Our site has a number of, shall we say, unoptimized URLs. I would like to change the URLs to be more relevant; if a page is about red widgets, the URL should be www.domain.com/red-widgets.html, right? I'm getting resistance on this, however, based on the belief that you lose something significant when you 301 an old URL to a new one. Now, I know that if you have a long chain of redirects, the spiders will stop following at some point, and that is a huge problem. That wouldn't apply if there's only one step in the chain, however. I've also heard that you lose some link juice in a 301, but I'm unsure how serious that problem actually is. Is it small enough that we'd win out in the long run with better-optimized URLs?

            On-Page Optimization | Sep 27, 2012, 1:49 AM | CMC-SD
            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
          • 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 - 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.