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
-
NO Meta description pulling through in SERP with react website - Requesting Indexing & Submitting to Google with no luck
Hi there, A year ago I launched a website using react, which has caused Google to not read my meta descriptions. I've submitted the sitemap and there was no change in the SERP. Then, I tried "Fetch and Render" and request indexing for the homepage, which did work, however I have over 300 pages and I can't do that for every one. I have requested a fetch, render and index for "this url and linked pages," and while Google's cache has updated, the SERP listing has not. I looked in the Index Coverage report for the new GSC and it says the urls and valid and indexable, and yet there's still no meta description. I realize that Google doesn't have to index all pages, and that Google may not also take your meta description, but I want to make sure I do my due diligence in making the website crawlable. My main questions are: If Google didn't reindex ANYTHING when I submitted the sitemap, what might be wrong with my sitemap? Is submitting each url manually bad, and if so, why? Am I simply jumping the gun since it's only been a week since I requested indexing for the main url and all the linked urls? Any other suggestions?
Web Design | | DigitalMarketingSEO1 -
Are Breadcrumbs Really Necessary?
An SEO provider suggested we add breadcrumbs to the top of each page about 3 years ago, which we did. 3 years later we are going thru the site and find it really busy with lots of redundant and distracting elements. We would like to remove the breadcrumbs from the top of the pages. Is there any real SEO downside to doing so?
Web Design | | Kingalan1
All URLs are listed on our site map so I don't see why Google would not index all pages. Our domain is www.metro-manhattan.com I have uploaded a sample page with a breadcrumb. Thanks,
Alan kbbpS0 -
Wordpress SEO/Tag plugin recommendation for sports (soccer) website
I own a Wordpress website which covers soccer in the DC MD VA area called DMV Soccer http://www.dmvsoccer.com/ We write weekly recaps where we tag a player who has scored a goal or performed well in a game. For each player, obviously, a tag is created. What I'm looking for is a plugin or solution that would allow me to tag a player, but also automatically assign a team to that player so that the team name and player's name are optimized on the individual player's tag page. So if I were to tag George Murphy on a recap, and I assign him to a team, let's say DC United. The tag page would have a title, something like: George Murphy Soccer Player for DC United and the meta description: George Murphy, soccer player from MD who players for DC United archives Or something similar, if that makes sense. Should I skip using tags and instead start assigning each player as a sub-category under each team? I'd like to try to avoid that, because not each category will be based on a player. Any suggestions in terms of existing plugins or other recommendations?
Web Design | | georgetsn1 -
Old Speed Reports
Hey all,
Web Design | | SEOSponge
We just moved our website to WordPress and trying to compare the new reports we are receiving for page speed/user experience to the old ones. Looking at dates before the relaunch, it looks as if old site speed reports are unavailable? Does anyone know of a way to recover older reports? We want to compare the responsive site/new desktop version to the old one (end users would have to "pinch" the screen to look at content on old site). Thanks in advance if you have any info!!!!0 -
Google result showing old Meta Title / Description even though page view source shows new info.
Hey guys! I'm struggling with why Google is ignoring my Meta Title / Description. I made a pretty drastic change to both about a week ago and on the results it hasn't changed. I'm on first page with several keywords and I think this weird caching is hurting me on where I'm at on the page. Thoughts / Ideas?
Web Design | | curtis_williams0 -
Website spread over two domains - The Good,The Bad and the Ugly ?
Hi, I am wondering if the way I have set up our website site is creating more harm than good ? All our SEO efforts and content is located @ www.sparrowmakeup.com.au however our portfolio is located at www.make-up-artists.com.au. Questions ? Will Analytic bounce rates effect my SERP, as most people click on the portfolio link in the first 5-15 sec of landing on our page ?? Is there a better way of setting it up ? the reason I set it up like this in the first place was because we wanted a different look/theme for the portfolio. (using WP) Is there any other issues that this setup might have in the SEO / SERP department ?? Is there any benefits and how can I maximize on them (silver lining) Your help and experience is greatly appreciated. Regards Ed
Web Design | | EdsonGroupMedia0 -
Intuit Website Hosting - Stand-Alone Webite?
Hi all! My name is Yehuda and I'm new to this community. There's an issue i'm having trouble with: My site is hosted by Intuit Websites, and I use their Website Builder. Though it has its own domain name, it seems my "site" may just be a subdomain of their intuitwebsites.com website. I'm trying to figure out if my site is actually a stand-alone website, and what ramifications/issues there be in terms of bot crawling & SEO. Does anyone have a thought on this?
Web Design | | Jorge1110 -
Meta author. Is it relevant for website design company in its seo?
We don't usually add the meta author in the websites that we develop. I wonder if it would have any positive effect in our seo. We usually add a link in the footer like this "Diseño Web Vigo "(Website Development in Vigo). I am worry about this links. I'm not sure if they are positive because they are in the footer and so the link appears in all of the pages. Besides all these websites we develop are hosted in two different servers, and google could easily think that it is manipulative thing. What do you think? Thanks!!! 🙂
Web Design | | teconsite.com0