【问题标题】:Wordpress permalink not working on awsWordpress 永久链接在 aws 上不起作用
【发布时间】:2015-04-28 20:28:37
【问题描述】:

我花了 4-5 个小时来整理它,但无法解决它。

我已经在 AWS 上设置了我的 wordpress 网站。除了 wordpress 的永久链接之外,所有文件都在工作。

当永久链接设置为默认页面/帖子可以正常工作但不能使用“%post-name%”时。

我已经通过谷歌搜索尝试了几乎所有的东西,但没有成功。

我看到了很多与 httpd.conf 文件相关的解决方案,但是在我的根目录下没有文件 httpd.conf 也没有 http 目录。

我在 apache.conf 文件中更改了以下代码,但仍然无法正常工作

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Require all denied
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

一次又一次地重新启动apache,但没有成功。

请帮帮我。

谢谢。

【问题讨论】:

    标签: wordpress apache amazon-web-services permalinks httpd.conf


    【解决方案1】:

    我刚刚设法修复了这个错误。 确保在更改 httpd.conf 后重新启动 Apache 服务!


    此处的文档有一份清单,其中列出了您需要让 wordpress 在 AWS 上正常工作所需的所有更改 - 包括正确获取权限:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html

    您需要修复永久链接的一点是 tp 更新 httpd.conf 文件

    (1) 位置:/etc/httpd/conf/httpd.conf

    (2) 查找以 &lt;Directory "/var/www/html"&gt;

    开头的部分
    <Directory "/var/www/html">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks
    
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride None
    
    #
    # Controls who can get stuff from this server.
    #
    Require all granted
    

    将上述部分中的 AllowOverride None 行更改为 AllowOverride All

    注意 该文件中有多个 AllowOverride 行;请务必更改该部分中的行。

    AllowOverride All
    

    (3)重启Apache服务

    【讨论】:

      【解决方案2】:

      如果您没有太多使用 aws 的经验,那么我猜是因为您没有为您的 apache 授予足够的权限。如果您不知道如何为您的 apache 授予权限,您可以在控制台中使用此命令

      sudo CHOWN -R apache:apache /var/www/html
      

      完成后尝试转到您的设置页面并保存新设置。

      【讨论】:

        猜你喜欢
        • 2018-01-03
        • 2016-12-07
        • 2011-05-18
        • 2015-07-03
        • 1970-01-01
        • 2021-07-06
        相关资源
        最近更新 更多