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 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

                  • 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

                  • What is the proper way to execute 'page to page redirection'
                    HiveDigitalInc
                    HiveDigitalInc
                    0
                    5
                    153

                  • Pagination and View All Pages Question. We currently don't have a canonical tag pointing to View all as I don't believe it's a good user experience so how best we deal with this.
                    PeteC12
                    PeteC12
                    0
                    3
                    117

                  • Server responds with 302 but the pages doesn't appear to redirect?
                    jim_shook
                    jim_shook
                    0
                    3
                    166

                  • Is 301 redirecting your index page to the root '/' safe to do or do you end up in an endless loop?
                    MikeRoberts
                    MikeRoberts
                    0
                    4
                    136

                  • %20 Rewrite in CMS doesn't get picked up by Search Engiens
                    DROIDSTERS
                    DROIDSTERS
                    0
                    3
                    277

                  • 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