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. Htaccess Redirect with %C2%A0 in URL

    Htaccess Redirect with %C2%A0 in URL

    Intermediate & Advanced SEO
    7 3 9.5k
    • 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.
    • pepsimoz
      pepsimoz last edited by

      Below is my setup for redirects in .htaccess file in my root word press installation.

      • The www to non-www works well, so no problems there
      • Other page redirects work well, too (example: redirect 301 /some-page/ http://mysite.com/another-page/ (I didn't post those because I have a few too many : )

      So here it goes...

      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
      RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L]

      BEGIN WordPress

      <ifmodule mod_rewrite.c="">RewriteEngine On
      RewriteBase /
      RewriteRule ^index.php$ - [L]
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule . /index.php [L]</ifmodule>

      END WordPress

      redirect 301 /archives/10-college- majors/ http://mysite.com/archives/10-college-majors/

      redirect 301 /archives/10-college-%20majors/ http://mysite.com/archives/10-college-majors/

      redirect 301 /archives/10-college-%C2%A0majors/ http://mysite.com/archives/10-college-majors/

      I'm having a problem with the last 301 redirect:

      • redirect 301 /archives/10-college-%C2%A0majors/ http://mysite.com/archives/10-college-majors/

      not working... As you can see I've tried using other varations of the "space" but no go. I also used a redirect in cPanel's Redirect screen; testing all the possible options + wildcard

      I've also tried this:

      • http://serverfault.com/questions/201829/using-special-characters-in-apache-mod-rewrite-rule (perhaps unsuccessfully, because it caused a 500 server error and it's a different situation in my case)

      I also saw something here:

      • http://www.webmasterworld.com/apache/3908682.htm

      but I don't know if it works and how I would implement that + do so without compromising ALL other redirects.

      Note: the URL displays with a space in the address bar of all major web browsers: http://mysite.com/10-college- majors/  and goes to a 404 page

      I have a goregous page / PR6 / high authority site linking to the URL on my site, but they copied the URL with a space somehow. I contacted the person responsible for the website and he claims it works fine (aka he didn't check it).

      Is there a clean way to redirect ONLY this problematic URL without compromising other redirects, etc?

      Any ideas would be great. I'll respond with progress. Thanks in advance.

      UPDATE
      the   redirect works, and it did work. Even so, when looking at source of page linking to mine, the URL looks like this: ```
      http://mysite.com/archives/10-college- majors/
      
      Clicking the URL in Source View in FireFox takes me to ```
      http://mysite.com/archives/10-college-%C2%A0majors/
      
      none of my 301 redirects should direct there. I don't have any redirect plugins either.
      
      
      
      
      1 Reply Last reply Reply Quote 0
      • DanDeceuster
        DanDeceuster last edited by

        Can't you look up the source code of the page with the link to you? In there you should find your link at

        pepsimoz 1 Reply Last reply Reply Quote 1
        • pepsimoz
          pepsimoz @DanDeceuster last edited by

          Dan,
          
          Thanks for your response. I tried your recommendations. None worked.
          
          http://mysite.com/archives/10-college- majors/ is what I found in the source code, but my AWSTATS and Google Webmaster Tools point to a URL %C2%A0 as the culprit 404 error. I double checked if the URL registering in my Stats and Google WT is from that PR6 page - yes it is.
          
          There's no space in the URL from source code and I did a 301 redirect with this variation (see original post)
          
          The url only shows the space in the browser's address bar, but not in source.
          
          UPDATE
          the   redirect works, and it did work. Even so, when looking at source of page linking to mine, the URL looks like this: ```
          http://mysite.com/archives/10-college- majors/
          
          Clicking the URL in Source View in FireFox takes me to ```
          http://mysite.com/archives/10-college-%C2%A0majors/
          
          none of my 301 redirects should direct there. I don't have any redirect plugins either.
          
          
          
          
          1 Reply Last reply Reply Quote 0
          • DanDeceuster
            DanDeceuster last edited by

            Instead of using the htaccess file, you should download a wordpress plugin called SImple 301 Redirects. It's very easy. Maybe if you do the 301 reidrects at the wordpress plugin level then wordpress can handle them better.

            pepsimoz 2 Replies Last reply Reply Quote 1
            • pepsimoz
              pepsimoz @DanDeceuster last edited by

              That is an idea I have contemplated, but I'm trying to limit the number of plugins. I have other redirects working very well, but this one with the "space" is so pesky. I would love to solve the issue using .htaccess if possible. I am looking into other solutions and will post here when anything comes up. In the meanwhile, I hope others may help, too.

              Dan, thank you for your great feedback.

              1 Reply Last reply Reply Quote 0
              • pepsimoz
                pepsimoz @DanDeceuster last edited by

                I ended up doing what you recommended. I downloaded the Redirection plugin.

                I copied the URL with %C2%A0 in it and setup a target URL without the space and the results were great. I double checked all my other redirects, in case of conflict - no worries there. Also I used the server header checker tool and saw a great 301 returning a 200 OK. That felt good.

                I still wanted to learn how to do it vs. how to "plug it" - see my thread here for all other woes related to this URL

                In the meanwhile I found out that it wasn't several great sites that were linking wrongly, it's like close to ten (some .edu, .org, and even one .mil - editorial links).

                Sometimes it's better to conform than to be a "purist". I saved tons of time by doing what I contemplated doing initially. Thanks for the push and for the help, Dan.

                KeriMorgret 1 Reply Last reply Reply Quote 0
                • KeriMorgret
                  KeriMorgret @pepsimoz last edited by

                  I had problems getting redirects for URLs with spaces in them working correctly on my own site, and ended up using the Redirection plugin as well, and it's worked like a charm.

                  The other thing I like about this plugin is the ability to see 404 errors and to set up redirects straight from that 404 list. If someone has linked to you and accidentally did a typo in the URL somewhere, or a comma got included in the hyperlink, you can see it in the 404 list and fix it right there.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  • What is the Redirect Rule for corresponding https urls to new domain with the same https urls?
                    WSIDW
                    WSIDW
                    0
                    2
                    62

                  • Redirect Issue in .htaccess
                    ThompsonPaul
                    ThompsonPaul
                    0
                    2
                    368

                  • Redirecting to Modal URLs
                    EGOL
                    EGOL
                    0
                    3
                    229

                  • How much is the effect of redirecting an old URL to another URL under a new domain?
                    JaneCopland
                    JaneCopland
                    0
                    4
                    89

                  • Should /node/ URLs be 301 redirect to Clean URLs
                    MargaritaS
                    MargaritaS
                    0
                    3
                    172

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

                  • Tracking URLS and Redirects
                    rhutchings
                    rhutchings
                    0
                    5
                    250

                  • Redirecting my new Website URL to my old Website URL
                    j0a0vargas
                    j0a0vargas
                    0
                    11
                    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