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. Intermediate & Advanced SEO
    4. Htaccess - Redirecting TAG or Category pages

    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.

    Htaccess - Redirecting TAG or Category pages

    Intermediate & Advanced SEO
    3
    4
    900
    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.
    • Jes-Extender-Australia
      Jes-Extender-Australia last edited by

      Hello Fellow Moz's,

      We have an issue redirecting some /TAG and /Category pages to inner pages.

      As an example we use:

      RedirectMatch 301 /category/Sample-Category(.*) https://OurDomain.com.au/New-Page//$1

      That works well.

      The issue is we have other categories and tags that are named similar to /Sample-Category

      As an example, if we try to redirect /Sample-Category-1 to /New-Page-1 - it will not work, and redirects to /New-Page

      I assume this is because /Sample-Category is already being redirected, so anything after /Sample-Category like -1 or -2 or -3 etc, will not be recognized.

      Anyone know of a workaround?

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

        The regex in your RedirectMatch doesn't say what you think it says, Jes 🙂

        This part (note the bolded part of the expression (.*)😞

        /category/Sample-Category**(.*)**

        doesn't actually say "match the URL that is specifically** /category/Sample-Category"**

        That**.*** is a wildcard thatmeans "and any other additional characters that might occur here"

        So what it's saying is "match the URL /category/Sample-Category _**as well as **_any URLs that have any additional characters after the letter "y" in category. Which is what is catching your -1 variation of the URL (or the -size-30 in your second example).

        In addition, that wildcard has been set as a variable (the fact it's in brackets), which you are then attempting to insert into the end of the new URL (with the $1), which I don't think is your intent.

        Instead, try:

        RedirectMatch 301 /category/Sample-Category https://OurDomain.com.au/New-Page/

        you should get the redirect you're looking for, and not have it interfere with the other ones you wish to write.

        Let me know if that solves the issue? Or if I've misunderstood why you were trying to include the wildcard variable?

        Paul

        P.S. You'll need to be very specific whether the origin or target URLs use trailing slashes - I just replicated the examples you provided.

        1 Reply Last reply Reply Quote 1
        • Jes-Extender-Australia
          Jes-Extender-Australia @seoman10 last edited by

          It's not as easy as that unfortunately.

          I will reiterate.....If we redirect.....

          RedirectMatch 301 /category/Blue-Shirts https://OurDomain.com.au**/Blue-Shirts**//$1 - it works, BUT....if we redirect another similar category page to different inner page like....

          RedirectMatch 301 /category/Blue-Shirts-Size-30 https://OurDomain.com.au****/Blue-Shirts-Size-30****//$1 - it redirects to the first inner page example above.

          That's why I was assuming it's not working because in the second example the sever sees /Blue-Shirts and ignores everything after it i.e the "Size-30".

          Hopefully that makes it clearer?

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

            If I've understood you correctly, all you need to do is to add a tag with the relevant content same as the old one.

            Jes-Extender-Australia 1 Reply Last reply Reply Quote 0
            • 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

            • JimJ

              Does having alot of pages with noindex and nofollow tags affect rankings?

              We are an e-commerce marketplace at for alternative fashion and home decor. We have over 1000+ stores on the marketplace.  Early this year, we switched the website from HTTP to HTTPS in March 2018 and also added noindex and nofollow tags to the store about page and store policies (mostly boilerplate content) Our traffic dropped by 45% and we have since not recovered. We have done I am wondering could these tags be affecting our rankings?

              Intermediate & Advanced SEO | | JimJ
              1
            • viatrading1

              Several 301 Redirects to Same Page

              Hi, I have 3 Pages we won't use anymore in our website. Let's call them url A, url B and url C. To keep their SEO strength on our domain, I've though about redirecting all of them to url D. For what I understand, when 301 redirecting, about 85-90% of the link SEO juice is passed. Then, if I redirect 3 URLs to the same page... does url D receive all the link SEO juices for URLs added up? (approximately)
              e.g. future url D juice = 100% current url D juice + 85% url A juice + 85% url B juice + 85% url C juice Is this the best practice, or is there a better way? Cheers,

              Intermediate & Advanced SEO | | viatrading1
              0
            • s_EOgi_Bear

              Google Rich Snippets in E-commerce Category Pages

              Hello Best Practice for rich snippets / structured data in ecommerce category pages? I put structured markup in the category pages and it seems to have negatively impacted SEO.  Webmaster tools is showing about 2.5:1 products to pages ratio. Should I be putting structured data in category Pages at all? Thanks for your time 🙂

              Intermediate & Advanced SEO | | s_EOgi_Bear
              0
            • Ask4443523

              H2 vs. H3 Tags for Category Navigation

              Hey, all. I have client that uses tags in the navigation for its blog.  For example, tags might appear around "Library," "Recent Posts," etc.  This is handled through their WordPress theme. This seems fairly standard, but I wonder whether tags are semantically appropriate.  Since each blog post is fairly lengthy (about 500-1000 words) with multiple tags, would it be more appropriate to use tags for this menu navigation?  Are we cutting into the effectiveness of our tags by using them for menu navigation? The navigation is certainly an important page element, and it structures content, so it seems that it should use some header tag.  Anyways, your thoughts are greatly appreciated.  I'm a content creator, not an SEO, so this is a bit out of my skillset.

              Intermediate & Advanced SEO | | Ask4443523
              0
            • Kung_fu_Panda

              Using href lang tag for multi-regional targeting on the same page

              Hi, I have the site au.example.com and I ranked on google AustraliaI would like to be ranked also in Google New Zeland for the same page (au.example.com) Because they are geographically & culturally close Can I place href lang tag for both countries and present the same page The code should look like: OR should i have create a different page for New Zealand (for eample: http://au.example.com/EN-NZ) And the code will look like: What will work better or there is other solution? Hope I’m clear.. Thanks!

              Intermediate & Advanced SEO | | Kung_fu_Panda
              0
            • BeytzNet

              How to 301 redirect old wordpress category?

              Hi All, In order to avoid duplication errors we've decided to redirect old categories (merge some categories).
              In the past we have been very generous with the number of categories we assigned each post. One category needs to be redirected back to blog home (removed completely) while a couple others should be merged. Afterwords we will re-categorize some of the old posts. What is the proper way to do so?
              We are not technical, Is there a plugin that can assist? Thanks

              Intermediate & Advanced SEO | | BeytzNet
              0
            • SamCUK

              Easy way to change wordpress category titles. Currently categories are appearing with the same title?!

              I'm working on a wordpress adult dating review site and have started to set up categories for each of my main keywords. I have also started to add sub categories by county and town and so far have done so for the counties of 'Lincolnshire' and 'Derbyshire'. The problem is though that for each of my subcategories the page titles are appearing the same. For example: www.mysite.com/category/online-dating/lincolnshire/spalding (root category online dating) shows the title as 'Spalding'. www.mysite.com/category/adult-dating/lincolnshire/spalding also has the title 'Spalding' even though it's root category is different (adult dating). It's probably easier to go to http://www.top-10-dating-reviews.com to see how it's set up. If you click in the category text in the top menu and navigate to dating/derbyshire/alfreton for example and then adult dating/derbyshire/alfreton you'll notice the page titles are the same. I use all in one SEO pack and have rewrite titles checked with category titles set to %category_title% | %blog_title%. I also use category SEO updater. In order to prevent duplicate content issues how can I simply make the title of each category category root title/category subtitle(county)/category subtitle 2(town). The title of each category page would then read for example Online Dating Lincolnshire Spalding.

              Intermediate & Advanced SEO | | SamCUK
              0
            • mjk26

              tags inside <a>tags - is this bad?</a>

              Hi, I'm currently redesigning my website, and in many places, I've now decided to make links a little bit more obvious for the user, using tags within a <a>tag in order to make the entire block of text clickable.  I was just wondering if this could have a negative impact in the search engines.  My gut feeling is no, since I'm actually improving usability, but I guess it could have an impact on how Google looks at the anchor text?  An example of the HTML is as follows: </a> <a></a> <a></a> [Cristal Night Club Hotels <address>1045 5th Street
              Miami Beach, FL33139</address> 6.4 miles from Miami Dade County Auditorium](http://localhost:8080/frontend/venue-hotels/cristal-night-club-hotels/301022 "Hotels near Cristal Night Club") Thanks for your thoughts and comments, Best wishes Mike

              Intermediate & Advanced SEO | | mjk26
              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.