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 problems on site not yet moved

    301 redirect problems on site not yet moved

    Technical SEO Issues
    13 2 1.2k
    • 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 @Wardy last edited by

      OK, so what you are actually trying to do is redirect from one page on the new server to another page on the new server, regardless of anything that is happening on the old server?

      Sha

      1 Reply Last reply Reply Quote 1
      • ShaMenz
        ShaMenz @Wardy last edited by

        If you post the content of your .htaccess file we can see if there is a problem with your syntax.

        Other things to remember:

        1. Don't qualify your FROM or TO (when you fail over your domain the .htaccess will break the site

        2. Remember that your WordPress installation will break when you fail over your domain as it has been installed to your test domain.

        Hope that helps,

        Sha

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

          Yes this is correct. Although I've tried it with the old page on the new server and with the old page not there on the new server but I can't get the re-direct to work.

          Below is the contents of my .htaccess file.

          Thankyou for your help!

          BEGIN WordPress

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

          END WordPress

          Options +FollowSymLinks
          RewriteEngine On
          RewriteCond %{QUERY_STRING} (<|%3C).script.(>|%3E) [NC,OR]
          RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
          RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
          RewriteRule ^(.*)$ index.php [F,L]

          Options -Indexes

          protect the htaccess file

          <files .htaccess="">order allow,deny
          deny from all</files>

          protect wpconfig.php

          <files wp-config.php="">order allow,deny
          deny from all</files>

          <files wp-login.php="">Order Deny,Allow
          Deny from All
          Allow from ...*</files>

          Redirect 301 /magazines.htm http://edit/~mysite/magazine-freebies

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

            Hi Wardy,

            The .htaccess file is read from top to bottom and the first Rule which matches is the Rule that will be used. This means that currently, your Wordpress Rule is a "catch-all" and the 301 will never be executed.

            So, the 301 needs to be placed above the Wordpress Rule in the .htaccess

            Hope this helps,

            Sha

            Wardy 1 Reply Last reply Reply Quote 1
            • Wardy
              Wardy @ShaMenz last edited by

              Thanks for the reply again Sha!

              So I have put

              Redirect 301 /magazines.htm http://edit/~mysite/magazine-freebies

              at the very top of the .htaccess but the redirect still does not take place.

              This is how it now looks. I'm sorry if I'm being daft here by the way!

              Redirect 301 /magazines.htm http://edit/~mysite/magazine-freebiesagazine-freebies

              Options +FollowSymLinks
              RewriteEngine On
              RewriteCond %{QUERY_STRING} (<|%3C).script.(>|%3E) [NC,OR]
              RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
              RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
              RewriteRule ^(.*)$ index.php [F,L]

              BEGIN WordPress

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

              END WordPress

              Options -Indexes

              protect the htaccess file

              <files .htaccess="">order allow,deny
              deny from all</files>

              protect wpconfig.php

              <files wp-config.php="">order allow,deny
              deny from all</files>

              <files wp-login.php="">Order Deny,Allow
              Deny from All
              Allow from ...**</files>

              ShaMenz Wardy 5 Replies Last reply Reply Quote 0
              • ShaMenz
                ShaMenz @Wardy last edited by

                Hi Wardy,

                I think we are nearly there 🙂

                This is what the first block of your .htaccess should look like:

                Options +FollowSymLinks
                RewriteEngine On

                **RewriteRule  ^/magazines.htm$ /magazine-freebies [R=301,L]**RewriteCond %{QUERY_STRING} (<|%3C).script.(>|%3E) [NC,OR]
                RewriteCond %{QUERY_STRING} GLOBALS(=|[|%[0-9A-Z]{0,2}) [OR]
                RewriteCond %{QUERY_STRING} _REQUEST(=|[|%[0-9A-Z]{0,2})
                RewriteRule ^(.*)$ index.php [F,L]

                The rest remains the same, but you will need to remove the old rule from the end of the file.

                Hope that helps,

                Sha

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

                  Thanks again for the reply and being patient!

                  It still isn't working for me.

                  Obviosuly magazines.htm hasn't been uploaded at any point on the new server but that won't make any difference would it?

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

                    Hi Wardy,

                    Check your Private Messages please.

                    Also, a couple of questions.

                    1. Is the file called .htaccess?
                    2. I the page magazine-freebies a static URL or a Wordpress Blog Category Page?

                    Please make your .htaccess file look like this

                    RewriteEngine On

                    RewriteRule  ^/magazines.htm$ /magazine-freebies

                    Just these two lines, and test to see if it works.

                    Sha

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

                      Hi Sha,

                      yes it all works, I think my problem was because of trying it on a test server etc.

                      You have abeen a great help! 🙂

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

                        Ah...Great news!

                        Glad to help and I hope the new site will do well for you 🙂

                        Sha

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • I've consolidated other domains to a single one with 301 redirects, yet the new domain authority in MOZ is much less that the redirected ones. Is that right?
                          MashBonigala
                          MashBonigala
                          2
                          3
                          232

                        • Redirect a 301 Redirect
                          RedCaffeine
                          RedCaffeine
                          0
                          5
                          98

                        • Best practice for eCommerce site migration, should I 301 redirect or match URLs on new site
                          Jinx14678
                          Jinx14678
                          0
                          4
                          1.2k

                        • 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

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

                        • Will 301 redirecting a site multiple times still preserve the original site value?
                          JoeAmadon
                          JoeAmadon
                          0
                          2
                          588

                        • 301 redirect .htaccess problem
                          sferrino
                          sferrino
                          0
                          4
                          709

                        • 301 redirect on the root of the site
                          DavidKauzlaric
                          DavidKauzlaric
                          0
                          5
                          1.0k

                        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