【问题标题】:Wordpress images not visible because of “This webpage has a redirect loop” error由于“此网页有重定向循环”错误,Wordpress 图像不可见
【发布时间】:2014-07-08 06:35:21
【问题描述】:

我在 blog 目录下的 magento 根文件夹中有 word press。这个博客目录是从一个实时站点复制到我的应用程序的。 (我在 Magento 中使用 fish pig magento 扩展来集成 word press)

/var/www/
      app
      blog

在 magento admin 中,我已将 Use Web Server Rewrites 设置为 NO

我在前端的图片有以下路径

http://www.example.com/blog/wp-content/uploads/2014/05/blogimage-150x150.png

此图像存在于指定位置。目录和文件的文件权限为777。但图像在前端博客页面中不可见。

当我在 Chrome 浏览器中手动输入此图片网址时,我收到 This webpage has a redirect loop 错误。在里面。

.htaccess blog 文件夹下的文件只有这一行DirectoryIndex index.php

我也试过这些命令

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');

应用程序托管在 nginx 上

更新

如果我将图像放置在 http://www.example.com/blog/wp-content/sample.jpg 位置,我也无法访问它。

如何解决这个重定向循环,有没有人可以帮忙?

【问题讨论】:

  • 根文件夹中的 htaccess 包含什么?
  • nginx 不会解析您的 htaccess wiki.nginx.org/LikeApache-htaccess
  • @masegaloeh 你说我没有得到是什么意思。
  • @KristofFeys Feys 在 magento roor 我有 magento 的 .htaccess 文件,在 blog 文件夹中我有 ..htcess 包含这个 DirectoryIndex index.php
  • 即使您的文件夹中有.htaccessnginx 也不会在该文件中包含任何配置。换句话说,您的.htaccessnginx 环境中将毫无用处

标签: wordpress .htaccess magento redirect nginx


【解决方案1】:

这个问题现在已经解决了。我阅读了fishpig的文档。它在安装指南下被提及。 如果您希望在 http://www.yourmagento.com/blog 上可以查看您的博客,请不要将 WordPress 安装在名为 blog 的子目录中。因此,建议您将 WordPress 安装在名为 wp 的子目录中

在我的例子中,wordpress 目录的名称和博客网址都是相同的,即。博客。当我将 wordpress 的目录名称从 blog 更改为 blogs 并在管理员下更改相同的设置以进行 fishpig 集成时。一切都开始正常了。

修复

如果您的 wordpress 的 url 为 www.example.com/blog ,则目录结构应如下所示

/var/www/
      app
      blogs (or something other than blog)

【讨论】:

    猜你喜欢
    • 2013-01-03
    • 1970-01-01
    • 1970-01-01
    • 2012-09-22
    • 2014-09-22
    • 1970-01-01
    • 1970-01-01
    • 2015-04-09
    相关资源
    最近更新 更多