【问题标题】:Wordpress install on heroku, accessing pages non root pages, server configuration在heroku上安装Wordpress,访问非根页面,服务器配置
【发布时间】:2018-04-13 01:53:52
【问题描述】:

我已经在 wordpress 的 heroku 上进行了本地安装,它安装良好并且运行良好。我可以设置它、构建页面、发布帖子,但是在路由方面,我遇到了问题。我似乎无法让创建的页面/帖子显示出来,而且无论我使用 ngnix 还是 apache 作为服务器,我都会收到 404。

例如,我正在使用 Apache2 部署 PHP 7.1.11,我的 Proc 文件是:

web: vendor/bin/heroku-php-apache2

/ 页面呈现良好。但是没有子页面,例如:

xyz.com/2017/10/test/ 导致 404,如日志中所示:

2017-10-31T19:16:35.829992+00:00 heroku[router]: at=info method=GET path="/2017/10/test/" host=xyv.com request_id=84ff659b-346e-4715-b629-66e13524b64c fwd="x.x.x.x" dyno=web.1 connect=0ms service=1ms status=404 bytes=377 protocol=htt

是否应该在 Procfile 中进行更多配置以使这项工作开箱即用?最好使用更漂亮的链接,例如/articlename/

【问题讨论】:

标签: php wordpress apache heroku


【解决方案1】:

请检查您的永久链接设置,它应该被配置为 index.php 进入您的网址。原因是在nginx服务器上,url中需要index.php,

如果您的帖子网址是 xyz.com/helloworld,请使用 index.php 尝试您的网址,然后在帖子网址中使用 xyz.com/index.php/helloworld 进行检查。

问题在于 url 尝试更改永久链接并设置为包含 index.php

/index.php/%postname%/

在上述设置中使用自定义永久链接选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-16
    • 1970-01-01
    • 2014-08-01
    • 2016-02-04
    • 1970-01-01
    相关资源
    最近更新 更多