简体   繁体   English

301 重定向 – Tumblr 到 Wordpress

[英]301 redirect – Tumblr to Wordpress

I've moved a blog from tumblr to wordpress, so far only the posts has been imported to the new wordpress setup.我已将博客从 tumblr 移至 wordpress,到目前为止,只有帖子已导入到新的 wordpress 设置中。 What's left is to do the 301 redirects.剩下的就是做 301 重定向。

I have more than little knowledge about this so therefore I need a little help.我对此知之甚少,因此我需要一些帮助。 A posts url in tumblr looks like this: tumblr 中的帖子 url 看起来是这样的:

example.com/post/[ID]/post-slug example.com/post/[ID]/post-slug

And in wordpress like this:在 wordpress 中是这样的:

example.com/2012/04/07/post-slug example.com/2012/04/07/post-slug

The post slug is equal so I guess there should be a way to accomplish this. post slug 是相等的,所以我想应该有一种方法可以做到这一点。 Oh and if it matters, the domain is the same.哦,如果重要的话,域是相同的。

I solved it myself using this piece of code:我使用这段代码自己解决了它:

RewriteRule ^/post/(.*?)/(.*?)$ /$2 [R=301,L]

But as I said, I'm not good at this so if anyone has something better, tell me.但正如我所说,我不擅长这个所以如果有人有更好的东西,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM