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
          • 301 redirect from dynamic url to static page
            alstam
            alstam
            0
            3
            297

          • 301 redirects - one overall redirect or an individual one for each page url
            Kurt_Steinbrueck
            Kurt_Steinbrueck
            1
            4
            160

          • 301: Dynamic URL to Static Page
            Aleyda
            Aleyda
            0
            7
            3.9k

          • 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

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

          • 301 redirects and Dynamic URLs
            Barrycliff68
            Barrycliff68
            0
            3
            1.1k

          • On Page 301 redirect for html pages
            randfish
            randfish
            0
            7
            1.6k

          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