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 From Dynamic Page To Static

    301 Redirect From Dynamic Page To Static

    Technical SEO Issues
    3 2 512
    • 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.
    • TheDude
      TheDude last edited by

      I want to 301 redirect all "id" and "type" numbers from my page dynamic.php page (I have thousands of IDs and thousands of Types) all to a single URL.

      So for example the following....

      www.mysite.com/dynamic.php?id=1&type=5

      www.mysite.com/dynamic.php?id=2&type=5

      www.mysite.com/dynamic.php?id=3&type=5

      www.mysite.com/dynamic.php?id=1&type=6

      www.mysite.com/dynamic.php?id=2&type=6

      www.mysite.com/dynamic.php?id=3&type=6

      ...would all be sent to:

      www.mysite.com/page.html

      How can this be done without doing a redirect for each ID/Type?

      1 Reply Last reply Reply Quote 1
      • BenFox
        BenFox last edited by

        If you're after redirecting mysite.com/page?id?=xyz to mysite.com/page the you can use RegEx in your .htaccess file to automatically does it for any variation of ID and TYPE.

        I'm not particularly technical so that's all I can offer but I'd love to see what other responses you get back.

        TheDude 1 Reply Last reply Reply Quote 0
        • TheDude
          TheDude @BenFox last edited by

          I figured it out!

          RedirectMatch 301 /dynamic.php(.*) https://www.mysite.com/page.htm

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Page for page 301 redirects from old server to new server
            cindyt-17038
            cindyt-17038
            0
            5
            398

          • Redirect a 301 Redirect
            RedCaffeine
            RedCaffeine
            0
            5
            98

          • 301 redirect all 404 pages
            alsvik
            alsvik
            0
            8
            3.6k

          • How does this rank? - a page that is 301 redirected
            Morris77
            Morris77
            0
            5
            279

          • Can you 301 redirect a page to an already existing/old page ?
            Bryan_Loconto
            Bryan_Loconto
            0
            3
            262

          • How do I 301 redirect a number of pages to one page
            AndersS
            AndersS
            0
            5
            404

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

          • 301 redirecting some pages directly, and the rest to a single page
            danrawk
            danrawk
            0
            3
            703

          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