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. Intermediate & Advanced SEO
    4. 301 doesn't redirect a page that ends in %20, and others being appended with ?q=

    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 doesn't redirect a page that ends in %20, and others being appended with ?q=

    Intermediate & Advanced SEO
    3
    7
    4328
    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.
    • Brocberry
      Brocberry last edited by

      I have a product page that ends /product-name**%20** that I'm trying to redirect in this way:

      Redirect 301 /products/product-name%20 http://www.site.com/products/product-name

      And it doesn't redirect at all. The others, those with %20, are being redirected to a url hybrid of old and new: http://www.site.com/products/product-name**?q=old-url**

      I'm using Drupal CMS, and it may be creating rules that counter my entries.

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

        I know this is an old thread, but I actually spotted this issue while trying to fix it myself. I was able to fix it by using quotes and a literal space. So for example, instead of

        RewriteRule ^/products/product%20name$ http://www.site.com/products/new-url [R=301,L]

        use

        RewriteRule "^/products/product name$" http://www.site.com/products/new-url [R=301,L]

        Hope that helps.

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

          I've managed to 301 everything except that pesky %20 url, perhaps because of the %20 or perhaps because that's also the only one in a folder.

          Here's what's worked for simple urls such as www.site.com/old-page

          RewriteRule ^old-page$ http://www.site.com/new-page  [R=301,L]

          But the same format for the %20 hasn't worked:

          RewriteRule ^/products/product-name%20$ http://www.site.com/products/new-url [R=301,L]

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

            I think this is the culprit:

            Rewrite URLs of the form 'x' to the form 'index.php?q=x'.

            RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico 
            RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

            At the moment,
            Redirect 301 /old-page http://www.site.com/new-page

            creates
            www.site.com/new-page?q=old-page

            I have tried the 301s both before the CMS rule and after it, without success.

            1 Reply Last reply Reply Quote 0
            • StreamlineMetrics
              StreamlineMetrics @Brocberry last edited by

              Hmmm... I was going to also suggest trying replacing the %20 with an actual space -

              Redirect 301 "/products/product-name " http://www.site.com/products/product-name

              Now that you say none of the redirects are working as expected, did you try adding the 301 redirects above the Drupal rules in your .htaccess file? Can you paste the contents of your .htaccess?

              1 Reply Last reply Reply Quote 1
              • Brocberry
                Brocberry @StreamlineMetrics last edited by

                Thanks for the reply. I tried it but it didn't work, but I given incorrect info in the question, which is now corrected. I had said other 301 were working fine when in fact they weren't. Those without %20 are redirecting to an odd hybrid of urls.

                After some searching, I think this has something to do with the drupal CMS and the rules it creates in htaccess.

                StreamlineMetrics Brocberry 2 Replies Last reply Reply Quote 0
                • StreamlineMetrics
                  StreamlineMetrics last edited by

                  Try putting it in quotes -

                  Redirect 301 "/products/product-name%20" http://www.site.com/products/product-name

                  Let me know if that doesn't work...

                  Brocberry 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

                  • matt.nails

                    301 Redirect from query string to new static page

                    If i want to create a redirect from a page where the slug ends like this "/?i=4839&mid=1000&id=41537" to a static, more SEO friendly slug like "/contact-us/", will a standard 301 redirect suffice? Thanks, Nails

                    Intermediate & Advanced SEO | | matt.nails
                    0
                  • Chris8198

                    301 Redirecting from domain to subdomain

                    We're taking on a redesign of our corporate site on our main domain.  We also have a number of well established, product based subdomains. There are a number of content pages that currently live on the corporate site that rank well, and bring in a great deal of traffic, though we are considering placing 301 redirects in place to point that traffic to the appropriate pages on the subdomains. If redirected correctly, can we expect the SEO value of the content pages currently living on the corporate site to transfer to the subdomains, or will we be negatively impacting our SEO by transferring this content from one domain to multiple subdomains?

                    Intermediate & Advanced SEO | | Chris8198
                    0
                  • Edward_Sturm

                    Why doesn't the Wikipedia homepage have meta tags?

                    Why doesn't the Wikipedia homepage have meta tags?

                    Intermediate & Advanced SEO | | Edward_Sturm
                    0
                  • Angelos_Savvaidis

                    Multilingual Site and 301 redirection

                    Hey there awesome people of Moz I have this site that has many languages in it. The main language is English and my developer did the following www.example.com ( is the main site ) which redirects with a 301 to www.example.com/en if your geo location is supported by our languages then you will automatically be redirected to whatever language you have in your country but does the first language with is english have to 301 redirect to www.example.com/en ? I thought that the right way is to just leave /en at the root file. Thanks in advance

                    Intermediate & Advanced SEO | | Angelos_Savvaidis
                    0
                  • WizardOfMoz

                    Redirect Search Results to Category Pages

                    I am planning redirect the search results to it's matching category page to avoid having two indexed pages of essentially the same content. Example http://www.example.com/search/?kw=sunglasses
                    wil be redirected to
                    http://www.example.com/category/sunglasses/ Is this a good idea? What are the possible negative effect if I go this route? Thanks.

                    Intermediate & Advanced SEO | | WizardOfMoz
                    0
                  • trung.ngo

                    Remove URLs that 301 Redirect from Google's Index

                    I'm working with a client who has 301 redirected thousands of URLs from their primary subdomain to a new subdomain (these are unimportant pages with regards to link equity). These URLs are still appearing in Google's results under the primary domain, rather than the new subdomain. This is problematic because it's creating an artificial index bloat issue. These URLs make up over 90% of the URLs indexed. My experience has been that URLs that have been 301 redirected are removed from the index over time and replaced by the new destination URL. But it has been several months, close to a year even, and they're still in the index. Any recommendations on how to speed up the process of removing the 301 redirected URLs from Google's index? Will Google, or any search engine for that matter, process a noindex meta tag if the URL's been redirected?

                    Intermediate & Advanced SEO | | trung.ngo
                    0
                  • brianmcc

                    Reverse Proxy better than 301 redirect?

                    Are reverse proxies that much better than 301 redirects? Should I invest the time in doing this? I found out about reverse proxies here: http://www.seomoz.org/blog/what-is-a-reverse-proxy-and-how-can-it-help-my-seo

                    Intermediate & Advanced SEO | | brianmcc
                    0
                  • Grenadi

                    301 - should I redirect entire domain or page for page?

                    Hi, We recently enabled a 301 on our domain from our old website to our new website. On the advice of fellow mozzer's we copied the old site exactly to the new domain, then did the 301 so that the sites are identical. Question is, should we be doing the 301 as a whole domain redirect, i.e. www.oldsite.com is now > www.newsite.com, or individually setting each page, i.e. www.oldsite.com/page1 is now www.newsite.com/page1 etc for each page in our site? Remembering that both old and new sites (for now) are identical copies. Also we set the 301 about 5 days ago and have verified its working but haven't seen a single change in rank either from the old site or new - is this because Google hasn't likely re-indexed yet? Thanks, Anthony

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