Redesigning a really old Website with old-fashioned permalinks
-
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!
-
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/
-
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.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Multiple H1 Tags for different section on one webpage in HTML5 Website? Should I have only one?
https://www.tcs.com website has multiple H1 tag on around 40 out of 1000 pages. Webpage has different section and each section is important that's why used multiple H1 tag (one h1 for each section) **I understand, google will not penalize for multiple H1. But having multiple H1, for site like tcs, is it good or should use only one H1 tag? **Pls check https://www.tcs.com to see heading tag(6 heading tag used).
Web Design | | JayprakashSEO0 -
Is The HREF Link "Title" Tag Needed on Mobile Websites?
Hello To Those Who Are Wiser Than I, I am wondering if the href link "title" tag is needed, or serves any purpose, on mobile websites? Also, does it effect SEO in any way? I ask because generally the href link title tag provides more information to the user when they scroll their mouse over the link - but this action does not happen on mobile! Users have no mouse and thus no extra information would be displayed. I'm really wondering if it still matters for SEO purposes on mobile though. -The UnEnlightened
Web Design | | Stew2220 -
Making a website menu + structure + hierarchies + kw research
When making a new website structure I assume we all think about SEO but at the same time as we can't forget UX.
Web Design | | ceranoktan
How much of your KW research would you implement in menu \ website structure?
What do you think is important to think about when making a website structure? Thank you in advance, BR,
Ceran0 -
SEO Tips for Affiliate Website
Hi all , I would just like to have an expert Opinion on SEO for Affiliate Website . Basically if I list all Third party products (Amazon/Affilate Window etc ) on my website and then the customer will be redirected to the Affiliates website to make a Purchase will there be an issue with SEO (Lots of Outgoing Url's) and Will the website not rank for Important keywords or will it be hit by any penalty ? I heard it's not good for SEO , any work around this ? If this is case How come cashback Sites rank well with no issues , although the concept is basically the same ? Any Tips or Advice appreciated as how to get this done safe . My Preferred Option would be with Magento Shopping Cart or second option would be with Wordpress Cart only in case this provides some SEO benefits over Magento by some plugins .
Web Design | | Aus0070 -
Duplicate content on websites for multiple countries
I have a client who has a website for their U.S. based customers. They are currently adding a Canadian dealer and would like a second website with much of the same info as their current website, but with Canadian contact info etc. What is the best way to do this without creating duplicate content that will get us penalized? If we create a website at ABCcompany.com and ABCCompany.ca or something like that, will that get us around the duplicate content penalty?
Web Design | | InvoqMarketing0 -
How do I deal with old software on my server?
I am currently running an old software called gallery2 on my website. I used it for years to showcase some of the work I have done. I switched over to Next Gen gallery some time ago, but I still have my gallery 2 online. Gallery 2 isn't really available on my website anymore unless people find it through search engines. The only reason I didn't delete it years ago was because I didnt know how that would effect my rankings. At the moment its not working...and instead of figuring out why, Id like to go ahead and remove it. How should I deal with any dead links? The problem is that I had a few hundred photos on gallery, so there will be an overwhelming number of dead links. I was thinking of making a new page on my site and just put all of my NextGen galleries on the page... and then just 301 everything that was located at /gallery2 to my new gallery page. Any suggestions would be greatly appreciated. Thanks! Tim
Web Design | | Timvroom0 -
Website Redesign 301 Question
Hey Moz gang, I have a question that I believe I know how I'm going to handle, but just wanted some feedback from the Moz community on best practices. At my company, we're going through a site redesign. At the moment, our site is deeper than it should be with many one-off feature pages. For example, we have a Features page that then links to individual pages for each specific feature. One goal we have set for the redesign is a condensing of the pages in order to make the site more user-friendly, easy to manage and content rich. My question is this. We have a lot of these individual pages that I want to essentially kill and merge into one page. It is okay (best practice) to 301 all of those individual feature specific pages to the single Features page since that is now where all of that content lives?? I want to retain the link juice that those pages have gained over time, but I don't want to get penalized for too many 301's to a single page. Any advice or previous experience would be awesome 🙂 Thanks, Lance
Web Design | | RobinBryant10 -
Does disabling the "View Source" functionality prevent Google from crawling a website?
I know Google uses a lot of variables when crawling a website. I wasn't sure if disabling the "View Source" option hindered anything.
Web Design | | innovationsimple0