301重定向与htaccess的距离的tumblr到Word preSS重定向、距离、htaccess、Word

2023-09-02 00:46:48 作者:超人的幸福需要咸蛋ヾ

我很新的与htaccess的,所以我需要一些光在这里。

I'm quite new with htaccess, so I'd require some light here.

我成立一个新的网站与Word preSS和希望重定向我的旧的tumblr职位的那些我导入到Word preSS。

I set a new site with Wordpress and want to redirect my old Tumblr posts to the ones I imported to Wordpress.

域名结构如下:

旧的tumblr:tumblr.domain.com

Old Tumblr: tumblr.domain.com

新概念英语preSS:www.domain.com

New Wordpress: www.domain.com

和员额结构是:

旧的tumblr:tumblr.domain.com/post/numberID/post-title

Old Tumblr: tumblr.domain.com/post/numberID/post-title

新概念英语preSS:www.domain.com/post-title

New Wordpress: www.domain.com/post-title

我做我的研究,我不知道为什么,由于某种原因,我只是有404

I made my research and I don't know why, by some reason I'm just having 404.

我还以为是我最好的选择是这样的:

What I thought was my best bet was this:

的RewriteCond%{HTTP_HOST} ^ tumblr.domain.com /后/(.*?)/(.*?)$ 重写规则http://www.domain.com/$2 [R = 301,L]

RewriteCond %{HTTP_HOST} ^tumblr.domain.com/post/(.*?)/(.*?)$ RewriteRule http://www.domain.com/$2 [R=301,L]

但不工作,我只有404

But doesn't work, I only have a 404.

注:我也看到我的家(www.domain.com)当进入tumblr.domain.com

Note: I also see my home (www.domain.com) when entering tumblr.domain.com

任何帮助将是非常一个preciated。先谢谢了。

Any help would be very apreciated. Thanks in advance.

推荐答案

没关系,解决了我自己,我不得不重建我的htaccess由于一些addiotional问题,我发现。 总之,对于任何试图重定向tumblr职位从一个子域到它的主域名,这是我做的:

Never mind, solved myself, I had to rebuild my htaccess due some addiotional problems I found. Anyway, for anyone trying to redirect tumblr posts from a subdomain to it's main domain, this is how I made it:

首先,301子域的域:

First, 301 from subdomain to domain:

的RewriteCond%{HTTP_HOST} ^ tumblr 。域 .COM [NC] 重写规则^(。*)http://www.domain.com/$1 [L,R = 301]

RewriteCond %{HTTP_HOST} ^tumblr.domain.com [NC] RewriteRule ^(.*) http://www.domain.com/$1 [L,R=301]

随后,301 tumblr职位,以导入的文章:

And then, 301 from tumblr posts to imported posts:

重写规则^(*)的http://www.domain.com$1 [L,R = 301] 重写规则^ /?交/([0-9] +)。(。*?)$ http://www.domain.com/$2 [L,R = 301]

RewriteRule ^(.*) http://www.domain.com$1 [L,R=301] RewriteRule ^/?post/([0-9]+).(.*?)$ http://www.domain.com/$2 [L,R=301]

有关某些情况下,我改名一些职位在我的新网站,所以不会对那些工作。我不得不手动重定向这些职位,所以我不得不上述行之后添加以下行:

For some cases, I renamed some posts in my new site, so it won't work for those. I had to redirect manually for those posts, so I had to add the following line after the lines above:

重写规则^旧后标题http://www.domain.com/new-post-title/ [R = 301,L]

希望这个作品的人在同样的情况。

Hope this works for someone in the same situation.