【问题标题】:How to host WordPress blog in Azure webapp's subfolder?如何在 Azure webapp 的子文件夹中托管 WordPress 博客?
【发布时间】:2017-11-08 10:00:04
【问题描述】:

我想在我现有的 Azure webapp 的子目录中托管一个 WordPress 博客,以便用户可以使用 URL“http://mywebappurl/blog/...”访问博客。我已尝试按照提到的步骤here

但是,现在当我访问网址“http://mywebappurl/blog/”时,我收到“糟糕,找不到该页面”错误,如图所示。

当我看到错误日志时,我得到如图所示的错误页面:

从图片中我感觉映射存在一些问题,因为它实际上并不是指路径 ../blog/.. 但我不知道如何解决这个问题。

我可以根据需要提供有关 Azure Web 应用配置的更多详细信息。

【问题讨论】:

  • 请阅读Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers? - 总结是这不是解决志愿者的理想方式,并且可能会适得其反。请不要将此添加到您的问题中。
  • 您是否更改了 MySQL 中的 siteurlhome 设置?
  • 是的,我已将站点网址和主页更改为“mywebsiteurl/blog
  • 您的wp-config.php 中有define('WP_HOME','http://example.com');define('WP_SITEURL','http://example.com'); 吗?
  • 我在 "wp-config.php" 中有以下详细信息: $connectstr_dbhost = 'localhost:49870'; $connectstr_dbname = 'localdb'; $connectstr_dbusername = '天蓝色'; $connectstr_dbpassword = '密码';定义('WP_HOME', 'http://'.filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));定义('WP_SITEURL', 'http://'.filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING));我需要改变这个吗?

标签: php wordpress azure blogs azure-web-app-service


【解决方案1】:

尝试如下设置wp-config.php中的常量:

define('WP_HOME', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). '/blog');
define('WP_SITEURL', 'http://'. filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). '/blog');
define('WP_CONTENT_URL', '/blog/wp-content');
define('DOMAIN_CURRENT_SITE', filter_input(INPUT_SERVER, 'HTTP_HOST', FILTER_SANITIZE_STRING). '/blog');

【讨论】:

    【解决方案2】:

    我已经在我的博文中介绍了这种情况:https://blogs.msdn.microsoft.com/kaushal/2014/04/19/microsoft-azure-web-sites-deploying-wordpress-to-a-virtual-directory-within-the-azure-web-site/

    这是关于旧门户的,但仍然与新门户相关。

    【讨论】:

      猜你喜欢
      • 2012-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多