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

    301 doesn't redirect a page that ends in %20, and others being appended with ?q=

    Intermediate & Advanced SEO
    7 3 3.3k
    • 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.
    • 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
      • 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
        • 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 @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 @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
              • 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
                • 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
                  • 1 / 1
                  • First post
                    Last post
                  • How long will old pages stay in Google's cache index. We have a new site that is two months old but we are seeing old pages even though we used 301 redirects.
                    DonnaDuncan
                    DonnaDuncan
                    0
                    3
                    81

                  • Crawl and Indexation Error - Googlebot can't/doesn't access specific folders on microsites
                    Everett
                    Everett
                    0
                    2
                    87

                  • Help me to understand why this page doesn't rank
                    fablau
                    fablau
                    0
                    15
                    155

                  • My crawl can't find ANY product pages. The links to product pages aren't links, they're script. :(
                    Joe.Robison
                    Joe.Robison
                    0
                    8
                    247

                  • I've seen and heard alot about city-specific landing pages for businesses with multiple locations, but what about city-specific landing pages for cities nearby that you aren't actually located in? Is it ok to create landing pages for nearby cities?
                    AlanMosley
                    AlanMosley
                    1
                    3
                    1.9k

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

                  • How to conduct catch 301 redirects & have the separate 301 redirects for the key pages
                    BenRWoodard
                    BenRWoodard
                    0
                    2
                    288

                  • Do I need to use canonical tags if I'm 301 redirecting pages?
                    RobertFisher
                    RobertFisher
                    0
                    2
                    423

                  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