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. Technical SEO Issues
    4. 301 redirect

    301 redirect

    Technical SEO Issues
    27 4 1.9k
    • 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.
    • ShaMenz
      ShaMenz @sesertin last edited by

      Hi again,

      We set up an example page for you with working tests and links to example code and zipped version.

      Hope that is what you need,

      Sha

      sesertin 1 Reply Last reply Reply Quote 1
      • AlanMosley
        AlanMosley last edited by

        the ^ symbol means the begins with, the $ means ends with

        so ^thisword$ means the URL must be a exact match "thisword"

        try simply thisword

        sesertin 1 Reply Last reply Reply Quote 0
        • sesertin
          sesertin @ShaMenz last edited by

          Thank  you a lot for your help, very much appriciated

          1 Reply Last reply Reply Quote 0
          • sesertin
            sesertin @AlanMosley last edited by

            Thanks, Alan. Not really like that, as my url contains additional characters both in the front and at the end of the word. By the way the links you sent me on the topic were great I am just having some hard time to understand them, they are a bit chinese to me, as I have no basics at all writing htaccess.

            AlanMosley sesertin ShaMenz 15 Replies Last reply Reply Quote 0
            • AlanMosley
              AlanMosley @sesertin last edited by

              Did you try it, it works for me.

              Just try simply thisword

              it should match aaaathiswordaaaaa

              this will work,

              [a-z]thisword [a-z]

              but so will

              thisword

              1 Reply Last reply Reply Quote 0
              • sesertin
                sesertin @sesertin last edited by

                still not working for me.

                The exact url is domain.com/?score=4&rew=25   (there are some more versions of course with different counters)

                I want to redirect all urls like this to domain.com

                tried:

                RedirectMatch 301 /[a-z]score[a-z] http://domain.com
                RedirectMatch 301 /.score. http://domain.com
                RedirectMatch 301 /^score$.* http://domain.com
                RedirectMatch 301 /.^score$.* http://domain.com

                none of them woks

                1 Reply Last reply Reply Quote 0
                • AlanMosley
                  AlanMosley @sesertin last edited by

                  i work on microsoft servers, so i am not sure about the sytax of htaccess.

                  but the regex is the same.

                  please try these.

                  RedirectMatch 301 [a-z]score[a-z] http://domain.com
                  RedirectMatch 301 score http://domain.com

                  you missed the *

                  1 Reply Last reply Reply Quote 0
                  • sesertin
                    sesertin @sesertin last edited by

                    Still not working for me. I tried further with:

                    RedirectMatch 301 [.]score[.] http://domain.com  (I thought a-z stands just for letter and urls contain number and marks)
                    RedirectMatch 301 [.]score[.] http://domain.com

                    neither works

                    1 Reply Last reply Reply Quote 0
                    • AlanMosley
                      AlanMosley @sesertin last edited by

                      You are correct, give me a munite and ill get back to you

                      1 Reply Last reply Reply Quote 0
                      • AlanMosley
                        AlanMosley @sesertin last edited by

                        try [a-z,0-9]score[a-z,0-9]

                        1 Reply Last reply Reply Quote 1
                        • AlanMosley
                          AlanMosley @sesertin last edited by

                          [a-z,0-9,=,&]alan[a-z,0-9,=,&]

                          get the idea

                          1 Reply Last reply Reply Quote 1
                          • AlanMosley
                            AlanMosley @sesertin last edited by

                            Here this will select your whole url

                            [a-z,0-9,=&?/.]score[a-z,0-9,=&]

                            1 Reply Last reply Reply Quote 1
                            • sesertin
                              sesertin @sesertin last edited by

                              nothing works. maybe I'll try posting another thread.

                              1 Reply Last reply Reply Quote -1
                              • AlanMosley
                                AlanMosley @sesertin last edited by

                                Well that will select your url, but what are you trying to do with it.

                                i have it working on IIS server using that regex, but i cant tell you how to use it in htaccess, as i dont use it

                                1 Reply Last reply Reply Quote 1
                                • sesertin
                                  sesertin @sesertin last edited by

                                  Thanks for the help. Regretfully this is my very first time writing htaccess so lot of faults can occur. I posted another thread maybe someone knows better than I do. Thank you very much for your time.

                                  1 Reply Last reply Reply Quote 0
                                  • ShaMenz
                                    ShaMenz @sesertin last edited by

                                    Hi Zsolt,

                                    Did you actually look at the link I gave you with the code that you needed?.

                                    The answer is to stop trying to use Redirectmatch and use the code I gave you in that example:

                                    RewriteEngine on
                                    
                                    RewriteBase /score
                                    
                                    RewriteCond %{QUERY_STRING} score=
                                    RewriteRule ^/*$ newlocation.html? [R=301,L]
                                    

                                    This is the simplest, cleanest, and most reliable solution to your problem.

                                    Sha

                                    1 Reply Last reply Reply Quote 3
                                    • sesertin
                                      sesertin @sesertin last edited by

                                      Yes, Sha looked at it and got a bit lost at once. I am totally new to server side codes and it needed a little modification but i got it working in the end. Thanks a lot.

                                      1 Reply Last reply Reply Quote 0
                                      • ShaMenz
                                        ShaMenz @sesertin last edited by

                                        Glad you got it worked out 🙂

                                        Don't forget if you need extra help on something you can always use the Private Message system in your profile to contact people direct.

                                        Have a great weekend,

                                        Sha

                                        1 Reply Last reply Reply Quote 0
                                        • AlanMosley
                                          AlanMosley @sesertin last edited by

                                          well done sha, i am afraid i got the wrong end of the stick, i thought he wanted to SELECT the url, not simply detect it.

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 1 / 2
                                          • First post
                                            Last post
                                          • 301 Redirects
                                            TheeDigital
                                            TheeDigital
                                            0
                                            3
                                            258

                                          • To 301 or not to 301?
                                            seorocket
                                            seorocket
                                            0
                                            3
                                            91

                                          • 301 redirects reverting to 302 redirects
                                            Devanur-Rafi
                                            Devanur-Rafi
                                            0
                                            6
                                            532

                                          • 301 redirects
                                            vibelingo
                                            vibelingo
                                            0
                                            5
                                            255

                                          • To 301 redirect or not to 301 redirect? duplicate content problem www.domain.com and www.domain.com/en/
                                            Chris-CA
                                            Chris-CA
                                            0
                                            5
                                            456

                                          • Delete 301 redirected pages from server after redirect is in place?
                                            RuthBurrReedy
                                            RuthBurrReedy
                                            0
                                            5
                                            4.0k

                                          • 301 Redirect Domain or 301 Redirect Domain + Interior Pages
                                            Room214
                                            Room214
                                            0
                                            7
                                            1.1k

                                          • Google Webmaster redirect vs 301 redirect
                                            lavellester
                                            lavellester
                                            0
                                            2
                                            493

                                          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