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
-
301 Redirect from Authoritative but Loosely-Related Domain
We acquired a health-related blog about a year ago with good domain authority and a pretty strong link profile (TF ~40). We have been publishing good relevant content in it but it's not really paying dividends and we are considering doing a 301 to our money site, which is focused primarily on senior issues but has a lot of health-related content. The question is - with the two domains only being loosely related in subject matter, do we stand to harm our main site by redirecting from the other domain?
Intermediate & Advanced SEO | | sa_787040 -
Penguin and 301 redirects...
Hi, I have several questions about starting a new domain due to Penguin. The site is: http://bajajlaw.com. Quick backstory: This site was hit every time Penguin rolled out. No clean-up was done until October 2015. At that time, I took over the project. My efforts include: (1) Remove'em, (2) manual removal, (3) and the Disavow Tool. The HP went from being at around #50 for the target KW (San Diego criminal defense attorney) to about #25. Never really moved higher than that. However, I redid the content for the internal pages (DV, Theft Crimes, etc.) and they are all ranking fairly well (first page or top of 2nd). In short, the penalty only seems to affect the HP, not the internal pages. Instead of waiting for Penguin to roll-out, client wants to move forward with new domain. My questions are as follow: 1. Can I use the same content for the internal pages and 301 from the old internal pages to the new? 2. Should I 301 from the old to the new domain for the HP, or not? 3. If I do a 301 from an internal page to a new internal page, does that have the same effect of doing a 301 from the old HP to the new HP? I have read various opinions on this topic. I'd appreciate feedback from anyone who has experience doing this sort of thing. Thanks. P.s. I'm inclined to wait for P4 to rollout, but given that nobody seems to know when that might be, it's hard for me to advise client to keep waiting for it.
Intermediate & Advanced SEO | | mrodriguez14400 -
URL Structure For E-commerce Sites
Hi Guys, I was wondering what would be the optimal and best URL structure for sub-categories on a E-commerce site for SEO purposes. Example if my category was dresses and I had multiple sub-categories within dresses would 1 or 2 below be the better URL structure? 1) Domain + Category + Sub-Category be the most suitable URL structure: Sleeveless Dresses URL: clothingstore.com/dresses/sleeveless-dresses Midi Dresses URL: clothingstore.com/dresses/midi-dresses 2) OR would excluding the category be better Domain + Sub-Category like: Sleeveless Dresses URL: clothingstore.com/sleeveless-dresses Midi Dresses URL: clothingstore.com/midi-dresses Do you think it makes much of a difference, is shorter better and more effective in this case? E.g. Rand discuses in this article: https://moz.com/blog/15-seo-best-practices-for-structuring-urls that having the keyword in the URL serves as anchor text, so wouldn't having additional keywords dilute value in this case? Plus he mentions shorter URLs the better. Cheers, Chris
Intermediate & Advanced SEO | | jayoliverwright1 -
Company Blog at a different URL
Ok, I have been doing a lot of work over the past 6 months, disavowing low quality links from spammy directories to our company website, etc. However, my efforts seem to have had a negative, not positive effect. This has brought me back to reconsidering what we are doing as we have lost a good amount of traction on the nationwide Google rankings specifically. Considering our company blog - platinumcctv(dot)net - we have used this blog for a long time to inform customers of new products, software developments and then to provide them links to purchase those components. Last week, I revamped the nearly default wordpress theme to another on a piece of advice. However, someone told me that all of our links should be nofollow, even though it is a company blog because we have many links coming from this domain, and it could be found as spammy. Potato/Potato - But before I start the tedious task of changing every link to no follow on a whim, i searched a lot, but have found no CLEAR substantiation of this. Any ideas? Other recommendations appreciated as well! Platinum-CCTV(dot)com
Intermediate & Advanced SEO | | PTCCTV0 -
Redirecting a redirect - thoughts?
Hi! A client has just had 14k 404s pop up in his WMT. I think this is because a page that they redirected to had moved. My question is, can I clean these up by redirecting the page the original redirect was one? If so, will it have any negative impact?
Intermediate & Advanced SEO | | neooptic0 -
How to decide on which site to 301 redirect
Hi there I'd like your opinions please! My client currently has their website at not-very-good-url.it which has a really good link profile they also have duplicate sites at: much-better-brand-name-url.it and much-better-brand-name-url.com but both these other sites have only a handful of links in. How important do you think a better brand url is? And therefore do you think it would be better to 301 to a better brand URL and take the risk that the link profile will get hit? Or leave the main site where it is and 301 the other two to it? Many thanks
Intermediate & Advanced SEO | | Chammy0 -
What is the Proper Use of 301 redirects for SEO purposes?
I heard and read from different sources that 301 redirects from aged domains with healthy link profiles is great to boost a sites rank as oppose to building a site around the page and linking it to the domain you want to rank. Whats is the best practice for this strategy? Thanks
Intermediate & Advanced SEO | | junkcars0 -
Url structure for multiple search filters applied to products
We have a product catalog with several hundred similar products. Our list of products allows you apply filters to hone your search, so that in fact there are over 150,000 different individual searches you could come up with on this page. Some of these searches are relevant to our SEO strategy, but most are not. Right now (for the most part) we save the state of each search with the fragment of the URL, or in other words in a way that isn't indexed by the search engines. The URL (without hashes) ranks very well in Google for our one main keyword. At the moment, Google doesn't recognize the variety of content possible on this page. An example is: http://www.example.com/main-keyword.html#style=vintage&color=blue&season=spring We're moving towards a more indexable URL structure and one that could potentially save the state of all 150,000 searches in a way that Google could read. An example would be: http://www.example.com/main-keyword/vintage/blue/spring/ I worry, though, that giving so many options in our URL will confuse Google and make a lot of duplicate content. After all, we only have a few hundred products and inevitably many of the searches will look pretty similar. Also, I worry about losing ground on the main http://www.example.com/main-keyword.html page, when it's ranking so well at the moment. So I guess the questions are: Is there such a think as having URLs be too specific? Should we noindex or set rel=canonical on the pages whose keywords are nested too deep? Will our main keyword's page suffer when it has to share all the inbound links with these other, more specific searches?
Intermediate & Advanced SEO | | boxcarpress0