【问题标题】:From Blogger to Wordpress: 301 Redirection for NGINX Server从 Blogger 到 Wordpress:NGINX 服务器的 301 重定向
【发布时间】:2020-02-21 15:13:39
【问题描述】:

也许有人可以帮助我。我想将我的博客从 Blogger 迁移到 Wordpress。文件的导入没问题,但现在我必须设置重定向。我发现的一切都是针对 Apache-Servers 的,但是我的新主机拥有现代 NGINX-Server,我无法更改 .htaccess。那么我如何进行从 Blogger 到 Wordpress 的有效 301 重定向?

非常感谢! 凯瑟琳

【问题讨论】:

  • 您在 blogger 或 example.blogger.com 子域上是否有自定义域名?
  • 重定向 301 / example.com
  • 我的博客有一个自定义域!

标签: wordpress nginx redirect blogger


【解决方案1】:

在服务器块中,你应该设置这个语句:

include /etc/nginx/301s/somesite.conf;

/etc/nginx/301s/somesite.conf中,添加这个:

location = /programs-services/ { return 301 https://www.somesite.com/; }

如果有效,请告诉我!

【讨论】:

    【解决方案2】:

    希望对你有所帮助。

    在 .htaccess 中添加下面提到的代码

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
      RewriteCond %{HTTP_HOST} ^www.olddomain.com$
      RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
    </IfModule>
    

    【讨论】:

    • 新主机在 NGinX-Server 上,所以我无法在 .htaccess 中进行工作更改...因此我已经询问了主机
    猜你喜欢
    • 2011-09-24
    • 1970-01-01
    • 1970-01-01
    • 2014-09-07
    • 1970-01-01
    • 2014-01-21
    • 1970-01-01
    • 2011-07-16
    • 2019-05-12
    相关资源
    最近更新 更多