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. Web Design
    4. Redesigning a really old Website with old-fashioned permalinks

    Redesigning a really old Website with old-fashioned permalinks

    Web Design
    3 2 211
    • 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.
    • dominator
      dominator last edited by

      Hey SEO-Pros,

      I'm currently redesigning a quite old website, with the following URL structure:

      TLD/category/category.php?interview_id=819

      The new Version will be a little more SEO-friendly:

      TLD/interviews/name-of-interview/

      I know I have to do a 301-Redirect for all the old URLs to the new ones in order to keep the (until now pretty good) Google Ranking. If the rankings drop after the redesign has been done, I'll surely get killed 😉

      So, Is there any easy way of creating these 301-Redirects (must be thousands of URLs...)?

      Best Regards guys and thanks for your help!

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

        Regex is the replacement language used to provide the logic for redirects. If you can establish a logical pattern for the redirects, then someone can write the Regex expression to perform the work.

        For example, if you used category ids and whenever category_id=1 you wanted it to be replaced with /interviews, you can write an expression to do such.

        Without seeing more information specific to your situation, I cannot comment if you can benefit from this method. In brief, try to find a pattern and articulate it. If you can say "I want to replace X with Y" then the solution will typically work.

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

          Thanks Ryan, so this means to get for example interview_id=819 redirected to the correct article, I have to provide the ID also in the new URL?

          TLD/category/category.php?interview_id=819

          to

          TLD/category/interview-name-819

          Should be something like this in Regex:

          RewriteRule ^category/([^/]+-)?([0-9]+)/?$ category/category.php?interview_id=$2

          EDIT: After working on it the whole day I found the following solution (as I'm working with Wordpress). Maybe it is useful for anyone:

          I'm using the following function now:

          add_action('parse_request','oldsite_redirect',0); // 0=before (most) 'parse_request' calls
          function oldsite_redirect() {
          if (isset($_GET['interview_id'])) {
          global $wpdb;
          $sql = "SELECT post_id FROM {$wpdb->postmeta} " .
          "WHERE meta_key='interview_id' AND meta_value='%s'";
          $sql = $wpdb->prepare($sql,$_GET['interview_id']);
          $post_id = $wpdb->get_var($sql);
          if ($post_id) {
          $permalink = get_permalink($post_id);
          if ($permalink) {

          wp_safe_redirect($permalink,301);
          exit;

          }
          }
          }
          }

          Solution found here: http://wordpress.stackexchange.com/questions/12824/url-rewrite-based-on-a-custom-field-value/

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post
          • How to Maintain SEO Rankings After Redesigning a Website?
            0
            1
            61

          • Any second opinions as to why our organic search website traffic hasn't recovered from website rebrand (domain change, website redesign)?
            nick49
            nick49
            0
            10
            212

          • Website Redesign - What to do with old 301 URLs?
            mememax
            mememax
            0
            3
            151

          • Website Redesign SEO Checklist
            stradiji
            stradiji
            0
            5
            5.4k

          • Website Redesign - Will it hurt SERP?
            howardd
            howardd
            0
            8
            2.6k

          • New Website Redesign: Any Design Comments or SEO Suggestions?
            Mike.Goracke
            Mike.Goracke
            0
            6
            319

          • Website Redesign 301 Question
            RobinBryant1
            RobinBryant1
            0
            3
            394

          • Does redesigning a website affects SEO results
            kadesmith
            kadesmith
            0
            5
            5.2k

          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