我花了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,但没有成功。
请大家帮帮我。
谢谢。
最佳答案
我刚刚设法修复了这个错误。 确保在更改 httpd.conf 后重新启动 Apache 服务!
<小时/>此处的文档提供了使 WordPress 在 AWS 上正确工作所需的所有更改的 list - 包括正确获取权限: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
将上一节中的 AllowOverride None 行更改为 AllowOverride All
注意 该文件中有多个AllowOverride行;请务必更改该部分中的行。
AllowOverride All
(3)重启Apache服务
关于WordPress 永久链接无法在 aws 上运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28742845/