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
-
Changing website to Mobile site
Hi All, We are building a new website and would take it live in next few weeks. I want help to understand what all should we consider.. The site structure would be same with additional features but the URL path and site name is same...Should i take any precausions before shutting down the old site and getting the new one live? Thanks
Web Design | | jomin740 -
Best techniques for trying to rank a single page website?
I am new to SEO and am currently trying to market a single page website. Its proving to be hard. I have managed to get the site to page one for a few keywords and it is improving (upto page 2 for some desired keywords) but it seems to have stuck there for a few weeks now - with no movement. I am able to develop it if required. However I thought that I would just ask if there was anything that could give it a nudge without this? I have done on-site optimisation. As far as I'm aware that's about as good as it can be. So any advice?
Web Design | | Chstphrjohn0 -
Website subscribe form.
Hello, Im working on a clients website and I have 2 box's. One is a subscription box and the other is a newsletter sing up. Subscription box is a google feedburner where every time there is a new post, it automatically notifies the readers. Whats the best strategy to have subscribe box since its confusing for readers when you have 2 forms. Thank you for your help.
Web Design | | KentR0 -
Best way to handle Spanish/English WEBSITE
Hey guys, How are you doing? I have a website (www.aceromart.com ) in which the primary language is Spanish. The company is oriented toward the Mexican Audience. However, recently we are dealing with many U.S companies. Also, we want to be included in the Yahoo Directory and several other directories which demand a U.S version of the website. So i want to have a U.S version of the website. My ecommerce is based in the NETWORK Solutions platform and has around 1,000 products and pages. What is the best way to include an English version of the website. Ive seen some pages using the Google traslate tool, which only traslates the text. Hope to hear some of your ideas, Regards,
Web Design | | JesusD0 -
Need some advice on changing website around.
I want to make some changes to my personal website and need a little help. I originally hired someone to create this site for me several years ago. Most of the site (including the home page) is html, but the blog part (/blog) is wordpress. The main site hasn't been updated in a few years (although the blog has been updated more often.) I'm not really targeting any keywords on my site (other than just my name) so I'm not really concerned about loosing any rank or anything. I"m just curious what the best route to go should be. Would you suggest keeping the site's format "as is" so to speak? (make the front page a landing page so to speak that links to my various sites, a little bio, etc; keep an about page, contact, /blog, etc...? ) Or should I go the more traditional route and make the blog the front page? Another route is to someone keep the most recent (1,2,or 3) posts on the home page (landing page) and sort of make it a landing page / recent post page. It's sort of like that now, only the main page just links to the most recent post instead of actually adding the post, if that makes sense. There maybe some themes out there that would work well, so feel free to suggest one if you know one that would work. I think the Aboutme.com pages look pretty nice and will let you use a custom domain, but I'm not sure. (And it's not a complete theme, so not sure that's the best option.) Thanks!
Web Design | | NoahsDad0 -
Rel Canonical tag usage on ECommerce website
Hello, I have read up on the rel canonical tag and I'm ready to apply it to my site's categorization structure. However, I'm concerned that, because my website does not have a "view all" button for our product pages, the rel canonical tag would not be appropriate. For example, if you come to my site's main category url, you come to mysite.com/main-category At this level - you get the top 12 items in the category. if you want to see the next page, you click a crawlable link that goes to mysite.com/main-category12-24 etc. etc. The site does not offer a view all function. Would applying the rel canonical tag be appropriate in this instance, or do I have to let Google crawl and index each page independantly? Thanks.
Web Design | | Blenny0 -
Redesign of an ecommerce site
I was just wondering how we should deal with filters and pagination with our ecommerce website. We can do nofollow or noindex, follow or canonical for both filters and pagination. Which one we should choose and why? By the way we are trying to create more sub categories to avoid too many pages but we have 1,000s products and we still end up with a quite high amount of pages. I've read a few conflicting seomoz QA about this issue. Many Thanks
Web Design | | Jvalops0