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. On-Page / Site Optimization
    4. 301 rediects - weird characters

    301 rediects - weird characters

    On-Page / Site Optimization
    10 4 243
    • 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.
    • Jon-C
      Jon-C last edited by

      Hi,

      Just cleaning up some 404 errors in my site in GWT and noticed a couple of external links pointing at me that are wrong.

      Basically they are from a couple of DIY forum sites (I've not put these links in place myself they are 100% natural) and it appears that the owners of the forums amend the links (inserting characters into link) so they are not quite right.

      How would I go about redirecting the following -

      www.example.co.uk/blueberry_pie.htm

      Whatever I try doesn't work and I always end up with a 404!

      Cheers
      J

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

        If you want to get the "SEO juice" from those pages that link to you, you can simple set up a 301 redirect to the page it's supposed to be pointed to. That should work just fine!

        Hope that helps!

        1 Reply Last reply Reply Quote -1
        • ThompsonPaul
          ThompsonPaul last edited by

          You're going to need to escape the unusual characters in the URL in order to redirect them, Teddi.

          When writing redirects, characters like < and > have special meaning as Regular Expression characters, so your server is trying to process those characters as their special regex functions, instead of just being plain old characters.

          The way to turn them back into regular old characters is to place a "****" in front of the special characters.

          So... the URL you are trying to redirect should be written as

          www.example.co.uk/blue<u>berry_pie.htm</u>

          Try that & let me know if it solves your problem.

          Paul

          Jon-C 1 Reply Last reply Reply Quote 1
          • Jon-C
            Jon-C last edited by

            Thanks text marketing, the question is how as because of the strange within the link it does not seem to work when I set up the 301 redirect.

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

              Where are you putting the redirect? The following code should work in your .htaccess file, regardless of the special character:

              redirect 301 /blueberry_pie.htm http://www.example.com/new-url.htm

              Jon-C 1 Reply Last reply Reply Quote 1
              • Jon-C
                Jon-C @ThompsonPaul last edited by

                Hi Paul

                Just tried and it didn't work, when looking in the html code the link appears as the following

                http://www.example.co.uk/blue<u>berry_pie.htm

                Would I stick the '' in before each of the % signs?

                Cheers
                T

                ThompsonPaul 1 Reply Last reply Reply Quote 0
                • ThompsonPaul
                  ThompsonPaul @Jon-C last edited by

                  Are you writing the redirects directly into an htaccess file, Teddi? Or into a plugin like WordPress's Redirection plugin?

                  Jon-C 1 Reply Last reply Reply Quote 0
                  • Jon-C
                    Jon-C @ThompsonPaul last edited by

                    Hi Paul,

                    Got it working, should have cleared my cache first! Tried Fetch as Google and it works!

                    Thanks for your help! 🙂

                    Ted

                    ThompsonPaul 1 Reply Last reply Reply Quote 0
                    • Jon-C
                      Jon-C @TakeshiYoung last edited by

                      Got it working! Should have cleared my cache first!

                      Cheers 🙂

                      Ted

                      1 Reply Last reply Reply Quote 0
                      • ThompsonPaul
                        ThompsonPaul @Jon-C last edited by

                        So was it escaping the special characters that did the trick, Ted?

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • 301 redirects
                          xinar
                          xinar
                          0
                          3
                          37

                        • 301 to canonical
                          ATP
                          ATP
                          0
                          6
                          165

                        • 301 directs
                          BlueprintMarketing
                          BlueprintMarketing
                          0
                          4
                          144

                        • 301 Target Path
                          TextMarketing
                          TextMarketing
                          0
                          2
                          119

                        • Can you 301 redirect to a page that has other pages 301 to it?
                          Cyrus-Shepard
                          Cyrus-Shepard
                          0
                          7
                          363

                        • How do I do a 301 Redirect in Wordpress
                          ShaMenz
                          ShaMenz
                          0
                          4
                          716

                        • 301 internal redirects
                          AmericanOutlets
                          AmericanOutlets
                          0
                          2
                          564

                        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