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. NGinx rule for redirecting trailing '/'

    NGinx rule for redirecting trailing '/'

    Intermediate & Advanced SEO
    2 2 92
    • 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.
    • AbsoluteDesign
      AbsoluteDesign last edited by

      We have successfully implemented run-of-the-mill 301s from old URLs to new (there were about 3,000 products). As normal. Like we do on every other site etc.

      However, recently search console has started to report a number of 404s with the page names with a trailing forward slash at the end of the .html suffix.

      So, /old-url.html is redirecting (301) to /new-url.html

      However, now for some reason /old-url.html/ has 'popped up' in the Search Console crawl report as a 404.

      Is there a 'blobal' rule you can write in nGinx to say redirect *.html/ to */html (without the forward slash) rather than manually doing them all?

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

        Hi there.

        Yes, the global rule should work. However, there is a reason this is happening, and it look like there is an extra rule, which adds that trailing slash. Go through those new rules you've added, make sure that you don't have anything extra. Example might be "Redirect everything from old blog to new blog with adding trailing slash" or something. It's quite common error, so you should be able to figure it out.

        Also see when these 404s were discovered, if it was right after you did redirects, it means for sure, that some of the new redirect rules are messed up at some point.

        Cheers!

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        • How to 301 Redirect /page.php to /page, after a RewriteRule has already made /page.php accessible by /page (Getting errors)
          DirkC
          DirkC
          0
          2
          435

        • I've got duplicate pages. For example, blog/page/2 is the same as author/admin/page/2\. Is this something I should just ignore, or should I create the author/admin/page2 and then 301 redirect?
          BeanstalkIM
          BeanstalkIM
          0
          5
          414

        • Help with https// redirects
          ForForce
          ForForce
          0
          5
          317

        • .htaccess 301 Redirect Help! Specific Redirects and Blanket Rule
          LynnPatchett
          LynnPatchett
          0
          3
          3.1k

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

        • 'Select your country' page leading to high Temporary Redirects
          Bio-RadAbs
          Bio-RadAbs
          0
          3
          312

        • Can you see the 'indexing rules' that are in place for your own site?
          Dr-Pete
          Dr-Pete
          0
          5
          451

        • Posing QU's on Google Variables "aclk", "gclid" "cd", "/aclk" "/search", "/url" etc
          0
          1
          2.3k

        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