WordPress 永久链接无法在 aws 上运行

Dhe*_*khi 4 apache wordpress permalinks httpd.conf amazon-web-services

我花了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>
Run Code Online (Sandbox Code Playgroud)

一次又一次重新启动apache,但没有运气。

请帮助我。

谢谢。

Gea*_*aru 5

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


这里的文档包含了让 WordPress 在 AWS 上正确工作所需的所有更改的清单 - 包括获得正确的权限:http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/hosting-wordpress.html

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

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

(2) 找到以以下内容开头的部分 <Directory "/var/www/html">

<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
Run Code Online (Sandbox Code Playgroud)

将上一节中的AllowOverride None行更改为AllowOverride All

注意 此文件中有多个AllowOverride行;确保更改该部分中的行。

AllowOverride All
Run Code Online (Sandbox Code Playgroud)

(3)重启Apache服务