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. 301 redirects.

    301 redirects.

    Intermediate & Advanced SEO
    5 3 270
    • 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.
    • AduroLabs
      AduroLabs last edited by

      Hi everyone,

      I am having some issues with an a few dynamic URLs that are not redirecting;

      Example:

      http://www.example.com/shop-online?page=shop.product_details&flypage=flypage_images.tpl&product_id=69164&category_id=303

      I first tried to carry out a standard 301 which looked like this;

      Redirect 301 /longurlwith&category_id=303 http://www.example.com/new-url

      Which didn't work. After a little bit of research I added the following into the htaccess file;

      RewriteCond %{HTTP_HOST} ^www.example.com$ [NC]RewriteRule ^/shop-online$(.*)$ http://www.example.com/shop-online$ [NE,L,R=301]

      Which caused the website to error 500 (Not cool).

      So now I am stumped. Any help would be really appreciated as I'm sure it's an easy fix but I can't quite my finger on it.

      Thanks in advance :).

      1 Reply Last reply Reply Quote 0
      • Matt-Williamson
        Matt-Williamson last edited by

        Hi Adam,

        Try this:

        RewriteCond %{QUERY_STRING} ^everything-after-the-question-mark$ RewriteRule ^shop-online$ http://www.new.com/new-page? [L,R=301]

        so above would be

        Options +FollowSymlinks RewriteEngine On

        RewriteCond %{QUERY_STRING} ^page=shop.product_details&flypage=flypage_images.tpl&product_id=69164&category_id=303$ RewriteRule ^shop-online$ http://www.new.com/new-page? [L,R=301]

        1 Reply Last reply Reply Quote 2
        • JarnoNijzing
          JarnoNijzing last edited by

          Hi there,

          i agree with matt but it could also be that the end of the redirect tag would be [R=301,L] in stead of [L,R=301]. This depends on the server. I had it happen to me a copple of times. Makes you question a lot of things and in the end it is as simple as this.

          hope this helps

          Matt +1

          Jarno

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

            This post is deleted!
            Matt-Williamson 1 Reply Last reply Reply Quote 0
            • Matt-Williamson
              Matt-Williamson @AduroLabs last edited by

              Hi Adam

              Yes you are correct as your query string is changing and so is the page you are directing to.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              • After 301 redirect
                OlegKorneitchouk
                OlegKorneitchouk
                0
                2
                54

              • 301 Redirection
                PremioOscar
                PremioOscar
                0
                9
                138

              • How to use a 301 Redirect when the first 301 Redirect is not the same as what's indexed?
                PatriotOutfitters81
                PatriotOutfitters81
                0
                3
                66

              • 301 Redirect To Another 301 Redirect
                cbielich
                cbielich
                0
                5
                247

              • Redirect 301
                SorinaDascalu
                SorinaDascalu
                0
                8
                174

              • 301 redirects
                jwdl
                jwdl
                0
                5
                113

              • 301 redirect
                Matt-Williamson
                Matt-Williamson
                0
                6
                284

              • Redirects 301
                PedroM
                PedroM
                0
                3
                339

              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