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
-
Website speed is above ?
I want to ask that my best tennis guru website speed is above 2.8 sec do it have any negative impact on my site?
Web Design | | looper50 -
Site redesign - 301 Redirects
I've just overhauled a website, leaving lots of former posts in the dust. I've set up a 404 redirect to the home page so that if anyone goes to one of those old pages they land on the home page instead of a dead 404. But, there's a couple urls from the old site I'd prefer to redirect to similar pages. These urls have forward slashes and I don't know how to get the slashes in when I copy it over to the new site. This is probably something easy, but I'm baffled. This www.lawbarron.com/personal-injury/whip-its-nitrous-oxide/ becomes this when I copy it www.lawbarron.com/personal-injury-whip-its-nitrous-oxide Can someone help me out?
Web Design | | julie-getonthemap0 -
Spanish website indexed in English, redirect to spanish or english version if i do a new website design?
Hi MOZ users, i have this problem. We have a website in Spanish Language but Google crawls it on English (it is not important the reasons). We re made the entire website and now we are planning the move. The new website will have different language versions, english, spanish and portuguese. Somebody tells me that we have to redirect the old urls (crawled on english) to the new english versions, not to the spanish (the real language of the firsts). Example: URL1 Language: Spanish - Crawled on English --> redirect to Language English version. the other option will be redirect to the spanish new version, which the visitor is waiting to find. URL1 Language: Spanish - Crawled on English --> redirect to Language Spanish version. What do you think? Which is the better option?
Web Design | | NachoRetta0 -
Are jobsite themes harder to optimize than say a traditional website?
Until recently I have enjoyed a great deal of success with SEO on my websites and clients websites. SEO is more of a hobby than a profession for me however I am really struggling with my latest website www.securityjobsuk.co.uk - The keywords are easy, 1. security jobs and 2. security vacancies. The site has vanished off radar completely since I used the jobify theme. Has anyone had similar experience with job boards? Do they require more TLC / expert attention?
Web Design | | SJUK0 -
For a real estate website, is a different mobile site warranted vs a responsive site?
I researched the major real estate websites: Zillow, Trulia, Remax, Keller Williams, Century 21, etc. They all have a separate mobile site and not a responsive one. The client wants it to be easy to search for properties from a smartphone. Is it possible to get a responsive version of a real estate website on a smartphone?
Web Design | | MassMedia0 -
Question About Site Redesign and Nav / Page Structure
Hey guys, i am currently redesigning our company's site, and have come across some things that I'm not quite sure of. We used to have individual service pages in our main navigation (design, video, marketing) before the redesign. In this new design, i had the idea of making just one "services" or "capabilities" page, where these three services would each be outlined, and each service would have a list of links to more specific landing pages. Obviously, breaking it up correctly with HTML5 using the andtags. What I'm wondering is that if i'm going to be penalized for having those three services that aren't necessarily related too closely on the same page as opposed to having the one page for each service (like we have now). Any help would be greatly appreciated, and let me know if i need to elaborate more. Thanks in advance!
Web Design | | RenderPerfect0 -
What is Best Platform to Build Website - SEO in mind
Hello... I am going to be creating two new websites shortly that will need to be built with SEO in mind. These will not be e-commerce sites, but instead will be informational with a couple pages of content on each. One will be used to get people to input their contact info and that info will be sent to our call center where we will call them back from. The other site will be heavily used for graphics, but still needs to have room for content (seo purposes)... Can you guys please recommend what platform i should have these sites written on (and please remember I need to do this on whatever is the most SEO-Friendly)... Thanks
Web Design | | Prime850 -
Old links in Google, new website affecting SEO?
Hi Guys, I have launched my website in october and it has already been indexed by google. Now I'm going to launch my redesign which comes with a new structure, content, links, etc. So the question is, do I have to resubmit my website to google to get rid of old links? Onsite Explorer shows links to my forum which has been spammed with p* stuff which has been already indexed as well. The forum is off now. I want to use SEOmoz to track my new website but I guess this could be a hard thing as old links etc will be shown as well. Is there any tool to let Google know about my changes? Does it affect my SEO in any way? Thank you for your help. Nick
Web Design | | NickITW0