Changing URL structure of date-structured blog with 301 redirects
-
Howdy Moz,
We've recently bought a new domain and we're looking to change over to it. We're also wanting to change our permalink structure. Right now, it's a WordPress site that uses the post date in the URL. As an example:
http://blog.mydomain.com/2015/01/09/my-blog-post/
We'd like to use mod_rewrite to change this using regular expressions, to:
http://newdomain.com/blog/my-blog-post/
Would this be an appropriate solution?
RedirectMatch 301 /./././(.) /blog/$1
-
Yes, sorry, I missed that part! That looks great.
-
Thanks! Yes, in my original post, I ask if the format of the mod_rewrite is correct for a 301 redirect. I realize we need 301 redirects. I am wanting to do it so I don't have to do a direct 1 to 1 for every page:
We'd like to use mod_rewrite to change this using regular expressions, to:
http://newdomain.com/blog/my-blog-post/
Would this be an appropriate solution?
RedirectMatch 301 /./././(.) /blog/$1
-
Whether you use a mod_rewrite or a 1 - 1 301, the end result is a 301 redirect. If you are changing the URL at all, even from http to https, you will need to tell Google that the URL has moved, hence, the 301 redirect. If you do not 301 redirect your old URLs you will lose all SEO value, traffic and link juice for the old URLs.
Does that make sense? Setting the redirects in Apache is simply a shortcut to the 301 step. Whichever path you take, you are ending at a 301.
And the syntax you wrote above looks correct for the rewrite script.
-
Hey Monica! Thanks for your response.
On Apache, you can set redirects before the server sends you to the domain. This is a preferred method for us. Erica was kind enough to suggest using WP to do so, but with thousands of blog posts, this really isn't an option to do a 1 to 1 301 redirect for every post.
Because of that, we're looking at **mod_rewrite **instead of a 301 plugin or using .htaccess, but I'm a little fuzzy on the appropriate syntax for it to work correctly.
-
Even if you are moving away from WP, you will set up your redirects the same way. You can do that through the HTAccess file to make sure that they are pointing to the correct pages on your new site.
-
Thanks for the response!
I should have mentioned that we are moving away from WP on the new domain.
-
I'd go in and change the structure in WP and then 301 the old URLs with the redirect. Then your new posts going forward will only have the cleaned up URL structure and the old ones will be properly 301'd for all the SEO goodness.
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
-
Unintentional wildcard 301 Redirect?
I have migrated a client's site to a new domain. I used Yoast tools to add 301 redirects for all active site pages from old domain to new domain in the .htacces files as neither the client nor I have access to hosting server via FTP (long story). Redirects are working as I intended, and we didn't lose too much in our rankings. Unfortunately, as soon as I saved the .htaccess file in Yoast, old-domain.net/wp-admin began redirecting to new-domain.net/wp-admin. I can no longer login to the wordpress site on the old domain. I did not enter a redirect for /wp-admin. Any thoughts on how this is happening or if there is some other way to get back in? Without server access, I'm pretty stumped. Thanks!
Intermediate & Advanced SEO | | c_estep_tcbguy0 -
URL structure - which one is better?
We are creating a new website and got stuck while deciding the URL structure. Our concern is which url is better in terms of SEO i.e. pune.fabogo.com/spa or fabogo.com/pune/spa and why. Also which one would rank faster if someone searches for **spas in pune if both **pages are same.
Intermediate & Advanced SEO | | fabogo_marketing0 -
Redirecting to Modal URLs
Hi everyone! Long time no chat - hope you're all well! I have a question that for some reason is causing me some trouble. I have a client that is creating a new website, the process was a mess and I am doing a last minute redirect file for them (long story, for another time). They have different teams for different business categories, so there are multiple staff pages with a list of staffers, and a link to their individual pages. Currently they have a structure like this for their staff bios... www.example.com/category-staff/bob-johnson/ But now, to access the staffers bio, a modal pops up. For instance... www.example.com/category-staff/#bob-johnson Should I redirect current staffers URLs to the staff category, or the modal URL? Unfortunately, we are late in the game and this is the way the bio pages are set up. Would love thoughts, thanks so much guys!!
Intermediate & Advanced SEO | | PatrickDelehanty0 -
Cleaning up backlinks and changing URLs
Currently we are performing very poorly in organic clicks. We are a e-commerce site with over 2000 products. Issues we thought plagued us: Copied Images from competitors Site wide duplicate content duplicate content from competitor site Number of internal links on a page (300+) Bad backlinks (2.3k from 22 domains and ips) being linked to from sites like m.biz URLs URLs are abbreviated, over 50% lack our keywords Lack of meta descriptions, or too long meta descriptions Current State of fixing these issues: 50% images are now our own Site wide duplicate content near 100% completed Internal links have been dealt with Rewrote content for every product 90% of meta descriptions are fixed From all of these changes we have yet to see increase in traffic...10% increase at best in organic clicks. We think we have penalties on certain URLs. My question for the MOZ community is what is the best way to attack the lack of organic clicks. Our main competition is getting 900% more clicks than us. Any more information you need on the topic let me know and will get back to you.
Intermediate & Advanced SEO | | TITOJAX0 -
How is my 301 redirected site stealing rankings from the main site?
Hello, I have a site, drhobelt.com, that 301 redirects to the main site, drhonow.com. Not only is drhobelt.com still indexed, but it recently stole rankings from drhonow.com for "decompression belt" related terms. What could be causing this? How do I reclaim the rankings for drhonow.com? Thanks for reading!!
Intermediate & Advanced SEO | | DA20130 -
Product URL structure for a marketplace model
Hello All. I run an online marketplace start-up that has around 10000 products listed from around 1000+ sellers. We are a similar model to etsy/ebay in the sense that we provide a platform but sellers to list products and sell them. I have a URL structure question. I have read http://www.seomoz.org/q/how-to-define-best-url-structure-for-product-pages which seems to show everyone suggests to use Products: products/category/product-name Categories: products/category as the structure for product pages. Because we are a marketplace (our category structure has multiple tiers sometimes up to 3) our sellers choose a category for products to go in. How we have handled this before is we have used: Products: products/last-tier-category-chosen/product-name (eg: /products/sweets-and-snacks/fluffy-marshmallows) Categories: products/category (eg: /products/sweets-and-snacks) However we have two issues with this: The categories can sometimes change, or users can change them which means the links completely change and undo any link building work built up. The urls can get a bit long and am worried that the most important data (the fluffy marshmallow that reflects in the page title and content) is left till too late in the URL. As a result we plan to change our URL structure (we are going through a rebuild anyhow so losing old links is not an issue here) so that the new structure was: Products: products/product-name(eg: /products/fluffy-marshmallows) Categories: products/category (eg: /products/sweets-and-snacks) My concern about doing this however, and question here, is whether this willnegatively impact the "structure" of pages when google crawls our marketplace.Because "fluffy marshmallows" will no longer technically fit into the url structure of "sweets and snacks". I dont know if this would have a negative impact or not. FYI etsy (one of the largest marketplace models in the world) us the latter approach and do not have categories in product urls, eg: listing/42003836/vintage-french-industrial-inspired-side Any ideas on this? Many thanks!
Intermediate & Advanced SEO | | LiamPatterson0 -
Is it safe to redirect multiple URLs to a single URL?
Hi, I have an old Wordress website with about 300-400 original pages of content on it. All relating to my company's industry: travel in Africa. It's a legitimate site with travel stories, photos, advice etc. Nothing spammy about. No adverts on it. No affiliates. The site hasn't been updated for a couple of years and we no longer have a need for it. Many of the stories on it are quite out of date. The site has built up a modest Mozrank value over the last 5 years, and has a few hundreds organically achieved inbound links. Recently I set up a swanky new branded website on ExpressionEngine on a new domain. My intention is to: Shut down the old site Focus all attention on building up content on the new website Ask the people linking to the old site to my new site instead (I wonder how many will actually do so...) Where possible, setup a 301 redirect from pages on the old site to their closest match on the new site Setup a 301 redirect from the old site's home page to new site's homepage Sounds good, right? But there is one issue I need some advice on... The old site has about 100 pages that do not have a good match on the new site. These pages are outdated or inferior quality, so it doesn't really make sense to rewrite them and put them on the new site. I call these my "black sheep pages". So... for these "black sheep pages" should I (A) redirect the urls to the new site's homepage (B) redirect the urls the old site's home page (which in turn, redirects to the new site's homepage, or (C) not redirect the urls, and let them die a lonely 404 death? OPTION A: oldsite.com/page1.php -> newsite.com
Intermediate & Advanced SEO | | AndreVanKets
oldsite.com/page2.php -> newsite.com
oldsite.com/page3.php -> newsite.com
oldsite.com/page4.php -> newsite.com
oldsite.com/page5.php -> newsite.com
oldsite.com -> newsite.com OPTION B: oldsite.com/page1.php -> oldsite.com
oldsite.com/page2.php -> oldsite.com
oldsite.com/page3.php -> oldsite.com
oldsite.com/page4.php -> oldsite.com
oldsite.com/page5.php -> oldsite.com
oldsite.com -> newsite.com OPTION 😄 oldsite.com/page1.php : do not redirect, let page 404 and disappear forever
oldsite.com/page2.php : do not redirect, let page 404 and disappear forever
oldsite.com/page3.php : do not redirect, let page 404 and disappear forever
oldsite.com/page4.php : do not redirect, let page 404 and disappear forever
oldsite.com/page5.php : do not redirect, let page 404 and disappear forever
oldsite.com -> newsite.com My intuition tells me that Option A would pass the most "link juice" to my new site, but I am concerned that it could also be seen by Google as a spammy redirect technique. What would you do? Help 😐1 -
Multiple 301 redirects considered a redirection chain?
I need to redirect a ton of duplicate content, so I want to try redirect 301 /store/index.php /store redirect 301 /store/product-old /store/product-new redirect 301 /store/product-old1 /store/product-new1 redirect 301 /store/product-old2 /store/product-new2 redirect 301 /store/product-old3 /store/product-new3 redirect 301 /store/product-old4/file.html /store/product-old4/new4/file.html and then a whole bunch of old dead links to homepage. So we've had /index.php redirected to / on other parts of the site for awhile, and for the most part /store is a friendly URL, but then we have tons of dup content and work arounds that preceded my job here. I'm wondering if those redirects above would be considered a redirection chain? Since the all the redirects below the /index.php -> /store count on that one redirect. Thanks for any insight you may be able to give!
Intermediate & Advanced SEO | | Hondaspeder1