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
    • MozCon
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Digital Marketers
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • 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.

    Let your business shine with Listings AI
    Moz Local

    Let your business shine with Listings AI

    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
    • Digital Marketers

      Simplify SEO tasks to save time and grow your traffic.

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

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

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.

Htaccess Redirect with %C2%A0 in URL

Intermediate & Advanced SEO
3
7
11.4k
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.
  • pepsimoz
    pepsimoz last edited by Mar 9, 2011, 7:35 PM

    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
    • KeriMorgret
      KeriMorgret @pepsimoz last edited by Mar 24, 2011, 12:51 AM Mar 24, 2011, 12:51 AM

      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
      • topic:timeago_earlier,12 days
      • pepsimoz
        pepsimoz @DanDeceuster last edited by Mar 12, 2011, 12:42 AM Mar 12, 2011, 12:42 AM

        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 Mar 24, 2011, 12:51 AM Reply Quote 0
        • pepsimoz
          pepsimoz @DanDeceuster last edited by Mar 10, 2011, 6:46 PM Mar 10, 2011, 6:46 PM

          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
          • DanDeceuster
            DanDeceuster last edited by Mar 12, 2011, 12:16 AM Mar 10, 2011, 2:21 PM

            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 Mar 12, 2011, 12:42 AM Reply Quote 1
            • pepsimoz
              pepsimoz @DanDeceuster last edited by Mar 10, 2011, 12:22 AM Mar 9, 2011, 10:09 PM

              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 Mar 9, 2011, 9:48 PM Mar 9, 2011, 9:48 PM

                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 Mar 9, 2011, 10:09 PM Reply Quote 1
                • 1 / 1
                1 out of 7
                • First post
                  1/7
                  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

                • cathywix

                  301 Redirects to relative URLs not absolute a problem?

                  Hi we recently did a migration and a lot of content changed locations see: https://d.pr/i/RvqI81 Basically, the 301 goes to the correct location but its a relative URL (as you can see from the screenshot) rather than absolute URL. Do you think this is a high priority issue from an SEO standpoint, should we get the developer to change the redirects to absolute? Cheers.

                  Intermediate & Advanced SEO | Feb 5, 2018, 8:56 AM | cathywix
                  0
                • Jes-Extender-Australia

                  Htaccess - Redirecting TAG or Category pages

                  Hello Fellow Moz's, We have an issue redirecting some /TAG and /Category pages to inner pages. As an example we use: RedirectMatch 301 /category/Sample-Category(.*) https://OurDomain.com.au/New-Page//$1 That works well. The issue is we have other categories and tags that are named similar to /Sample-Category As an example, if we try to redirect /Sample-Category-1 to /New-Page-1 - it will not work, and redirects to /New-Page I assume this is because /Sample-Category is already being redirected, so anything after /Sample-Category like -1 or -2 or -3 etc, will not be recognized. Anyone know of a workaround?

                  Intermediate & Advanced SEO | Dec 31, 2017, 10:30 PM | Jes-Extender-Australia
                  0
                • FPK

                  Hacked website - Dealing with 301 redirects and a large .htaccess file

                  One of my client's websites was recently hacked and I've been dealing with the after effects of it. The website is now clean of malware and I already appealed to Google about the malware issue. The current issue I have is dealing with the 20, 000+ crawl errors which are garbage links that were created from the hacking. How does one go about dealing with all the 301 redirects I need to create for all the 404 crawl errors? I'm already noticing an increased load time on the website due to having a rather large .htaccess file with a couple thousand 301 redirects done already which I fear will result in my client's website performance and SEO performance taking a hit as well.

                  Intermediate & Advanced SEO | Oct 22, 2016, 2:33 AM | FPK
                  0
                • MiguelSalcido

                  Linking to URLs With Hash (#) in Them

                  How does link juice flow when linking to URLs with the hash tag in them? If I link to this page, which generates a pop-over on my homepage that gives info about my special offer, where will the link juice go to? homepage.com/#specialoffer Will the link juice go to the homepage? Will it go nowhere? Will it go to the hash URL above? I'd like to publish an annual/evergreen sort of offer that will generate lots of links. And instead of driving those links to homepage.com/offer, I was hoping to get that link juice to flow to the homepage, or maybe even a product page, instead. And just updating the pop over information each year as the offer changes. I've seen competitors do it this way but wanted to see what the community here things in terms of linking to URLs with the hash tag in them. Can also be a use case for using hash tags in URLs for tracking purposes maybe?

                  Intermediate & Advanced SEO | Apr 22, 2015, 5:06 PM | MiguelSalcido
                  0
                • IanOBrien

                  Changing URL structure of date-structured blog with 301 redirects

                  Howdy Moz, We've recently bought a new domain and we're looking to change over to it. We're also wanting to change our permalink structure. Right now, it's a WordPress site that uses the post date in the URL. As an example: http://blog.mydomain.com/2015/01/09/my-blog-post/ We'd like to use mod_rewrite to change this using regular expressions, to: http://newdomain.com/blog/my-blog-post/ Would this be an appropriate solution? RedirectMatch 301 /./././(.) /blog/$1

                  Intermediate & Advanced SEO | Feb 3, 2015, 12:52 PM | IanOBrien
                  0
                • jasondexter

                  Multiple 301 redirects for a HTTPS URL. Good or bad?

                  I'm working on an ecommerce website that has a few snags and issues with it's coding. They're using https, and when you access the website through domain.com, theres a 301 redirect to http://www.domain.com and then this, in turn, redirected to https://www.domain.com. Would this have a deterimental effect or is that considered the best way to do it. Have the website redirect to http and then all http access is redirected to the https URL? Thanks

                  Intermediate & Advanced SEO | Apr 29, 2014, 5:09 AM | jasondexter
                  0
                • 379seo

                  Canonical URLs and Sitemaps

                  We are using canonical link tags for product pages in a scenario where the URLs on the site contain category names, and the canonical URL points to a URL which does not contain the category names.  So, the product page on the site is like www.example.com/clothes/skirts/skater-skirt-12345, and also like www.example.com/sale/clearance/skater-skirt-12345 in another category.  And on both of these pages, the canonical link tag references a 3rd URL like www.example.com/skater-skirt-12345.  This 3rd URL, used in the canonical link tag is a valid page, and displays the same content as the other two versions, but there are no actual links to this generic version anywhere on the site (nor external). Questions: 1. Does the generic URL referenced in the canonical link also need to be included as on-page links somewhere in the crawled navigation of the site, or is it okay to be just a valid URL not linked anywhere except for the canonical tags? 2. In our sitemap, is it okay to reference the non-canonical URLs, or does the sitemap have to reference only the canonical URL?  In our case, the sitemap points to yet a 3rd variation of the URL, like www.example.com/product.jsp?productID=12345.  This page retrieves the same content as the others, and includes a canonical link tag back to www.example.com/skater-skirt-12345.  Is this a valid approach, or should we revise the sitemap to point to either the category-specific links or the canonical links?

                  Intermediate & Advanced SEO | Oct 26, 2012, 6:28 PM | 379seo
                  0
                • Prime85

                  301 Redirect - What happens to backlinks

                  Hello... One of my sites is losing rankings in G. I received the webmaster notification of unnatural links... My question is, should i do a 301 redirect of every page on my site to a new domain? If so, do the backlinks (which i believe are causing my rankings to drop) carry over? How about the good backlinks? Also, what would happen to the rankings i currently have on page 1? Thanks

                  Intermediate & Advanced SEO | Nov 6, 2017, 1:07 PM | Prime85
                  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.