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. Technical SEO
  4. Web config redirects not working where a trailing slash is involved

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.

Web config redirects not working where a trailing slash is involved

Technical SEO
2
5
7.0k
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.
  • AndrewAkesson
    AndrewAkesson last edited by Mar 26, 2012, 7:20 AM

    I'm having real trouble with getting working redirects in place to use on a site we're re-launching with a modified url structure.

    Old URL: http://www.example.com/example_folder/

    New URL: http://www.example.com/example-of-new-folder/

    Now, where the old URL's have a trailing slash the web.config simply will not accept it. It says the URL can start with a slash, but not end with a slash. However, many of my URL's do end with a slash so I need a workaround.

    These are the rules I'm putting in place:

    <location path="example_folder/"></location>

    Thanks

    1 Reply Last reply Reply Quote 0
    • AndrewAkesson
      AndrewAkesson last edited by Mar 26, 2012, 10:55 AM Mar 26, 2012, 10:55 AM

      That works perfectly, thank you very much

      1 Reply Last reply Reply Quote 0
      • AlanMosley
        AlanMosley @AndrewAkesson last edited by Mar 26, 2012, 10:54 AM Mar 26, 2012, 9:42 AM

        The following will work for both slash and no slash,

        <rule name="Test" stopprocessing="true"><match url="^example_folder"><action type="Redirect" url="/newfolder"></action></match></rule>

        if not sure where to place it, see link in last post, bottom of page

        1 Reply Last reply Reply Quote 1
        • AndrewAkesson
          AndrewAkesson @AlanMosley last edited by Mar 26, 2012, 9:30 AM Mar 26, 2012, 9:30 AM

          Thanks for the response Alan.

          However, the problem is with the old URL's, so where they have a trailing slash I cannot get them to redirect to any URL's of the new structure (with a trailing slash or otherwise.).

          To simplify the ask, how do I put in place a 301 redirect from 'http://www.example.com/example_folder/' to some other URL?

          AlanMosley 1 Reply Last reply Mar 26, 2012, 9:42 AM Reply Quote 0
          • AlanMosley
            AlanMosley last edited by Mar 26, 2012, 8:48 AM Mar 26, 2012, 8:48 AM

            i would first decide if you want a slash or not. i prefer not as when people type urls they rarly add a slash on the end.

            see this page will tell you how to remove all slashes and then your redirects should work

            http://thatsit.com.au/seo/tutorials/how-to-fix-canonical-issues-involving-the-trailing-slash

            AndrewAkesson 1 Reply Last reply Mar 26, 2012, 9:30 AM Reply Quote 0
            • 1 / 1
            1 out of 5
            • First post
              1/5
              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

            • photoseo1

              Redirecting an Entire Website?

              redirecting domain redirect former site

              Is it best to redirect an old website to a new website page by page to like pages or just the entire site all at once to the home page of the new site? I do have about 10 good pages on the site that are worth directing to corresponding pages on the new site. Just trying to figure out what is going to preserve the most link juice. Thanks for the help!

              Technical SEO | Apr 7, 2024, 8:55 AM | photoseo1
              0
            • LASClients

              302 redirects in Magento, trying to fix

              magento 302

              Hi all, I'm assigned a site in Magento. After the first craw, we found almost 15k 302 redirects. A sample URL ends with this /stores/store/switch/?SID=qdq9mf1u6afgodo1vtvk0ucdpb&___from_store=default&___store=german&uenc=aHR0cHM6Ly9qdWljeWZsdXRlcy5jb20vP19fX3N0b3JlPWdlcm1hbg%2C%2C And they are currently 302 redirecting to the homepage as well as other main pages and also product pages it seems. Some of these point to account pages where customers log in. Probably best for me to de-index those so no issues there. But I'm worried about the 302 redirects to public pages. The extension we have installed is SEO Suite Ultimate by MageWorx. Does anyone here have experience here specifically and how did you fix it? Thanks, JC

              Technical SEO | Sep 30, 2021, 11:12 PM | LASClients
              0
            • wearehappymedia

              Should we set up redirects for all deleted TAGS?

              We recently found our site had 65,000 tags (yes 65K). In an effort to consolidate these we've started deleting them. MOZ is now reporting a heap of 404 errors for tag pages. These tag pages should not have links to them so not sure how come they're being crawled. Any suggestions from experience in this area would be useful.

              Technical SEO | Aug 24, 2020, 11:39 AM | wearehappymedia
              0
            • FreddyKgapza

              Redirect to http to https - Pros and Cons

              Hi, I know its best practice to redirect a website from http to https, instead of having many entry point to your website. When a website has been running for a long time on http and https, what are the SEO Pros and Cons of implementing a redirect from Http to Https?

              Technical SEO | Jul 9, 2019, 3:23 AM | FreddyKgapza
              1
            • AaronHenry

              WPEngine Causing Redirect Chain

              Hi guys, Had a quick question that I wanted to verify here. After reviewing a Moz report we received some redirect chain error on all of our sites hosted with WPEngine. We noticed that the redirect chain appears to be coming from how the domains are configured in their control panel. Essentially, there is a redirect: from staging/temp -> to live from non-www -> to www SSL redirect from http -> https The issue here is that the non-www is redirecting to www and then redirected again to https://www According to support the only way to get rid of this error is to drop the www version of the domain and to host everything under https://domain.com. To me it seems very odd that you cannot just go from http://non-www to https://www in just 1 301 redirect. Has anyone else experienced this or am I just not looking at the situation correctly?

              Technical SEO | Aug 10, 2022, 4:01 PM | AaronHenry
              0
            • thinkLukeSEO

              Backlinks that go to a redirected URL

              Hey guys, just wondering, my client has 3 websites, 2 of 3 will be closed down and the domains will be permanently redirected to the 1 primary domain - however they have some high quality backlinks pointing the domains that will be redirected. How does this effective SEO? Domain One (primary - getting redesign and rebuilt) - not many backlinks
              Domain Two (will redirect to Domain One) - has quality backlinks
              Domain Three (will redirect to Domain One) - has quality backlinks When the new website is launched on Domain One I will contact the backlink providers and request they update their URL - i assume that would be the best.

              Technical SEO | Feb 21, 2023, 1:08 PM | thinkLukeSEO
              0
            • Francis.Magos

              Why does my Google Web Cache Redirects to My Homepage?

              Why does my Google Webcache appears in a short period of time and then automatically redirects to my homepage? Is there something wrong with my robots.txt? The only files that I have blocked is below: User-agent: * Disallow: /bin/ Disallow: /common/ Disallow: /css/ Disallow: /download/ Disallow: /images/ Disallow: /medias/ Disallow: /ClientInfo.aspx Disallow: /*affiliateId* Disallow: /*referral*

              Technical SEO | Jun 16, 2016, 6:08 AM | Francis.Magos
              0
            • twotd

              301 redirect not working

              Hi there! I have recently moved a domain that has been indexed by google and setup redirects so that it forwards to the new domain. It seems like the only redirect that actually is working is the canonical and main domain but every other page and or page nested within a folder are not working. Here is an example of some of the redirects. Am I doing this wrong? It seems to be going to the new domain but can't find the actual pages.... RewriteEngine On
              RewriteBase /
              RewriteCond %{HTTP_HOST} !agoodsweep.com$ [NC]
              RewriteRule ^(.*)$ http://agoodsweep.com/$1 [L,R=301]
              redirect 301 woodstoveservicerepair.html http://agoodsweep.com/woodstoveservicerepair/
              redirect 301 /westchesterchimney.html http://agoodsweep.com/west-chester-chimney/ Thanks in advance for any help!!

              Technical SEO | Mar 27, 2013, 5:36 PM | twotd
              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.