wordpress - 非 www 到 www 不适用于使用 safari 的 EC2 实例中的 wordpress
问题描述
如果我使用我的 Safari 浏览器,我无法访问我的网站 example.com。我必须使用 www.example.com 才能工作。我尝试多次编辑 htaccess,但仍然无法正常工作。我的网站使用的是托管在 AWS 中的bitami wordpress 图像(https://docs.bitnami.com/ )。
解决方案
Bitnami 工程师在这里:
默认情况下,出于安全和性能原因,我们禁用 .htaccess 文件。我们还将.htaccess
文件内容移动到文件htaccess.conf
夹 /opt/bitnami/apps/wordpress/conf 中的一个文件中。您可以在https://docs.bitnami.com/aws/infrastructure/lamp/administration/use-htaccess/查看更多信息。
如果要启用 .htaccess 使用,则需要将其设置为AllowOverride All
文件/opt/bitnami/apache2/conf/bitnami/bitnami.conf
:
<VirtualHost _default_:80>
DocumentRoot "/opt/bitnami/apache2/htdocs"
<Directory "/opt/bitnami/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All <---- HERE
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>
并在应用更改后重新启动 Apache。
有关更多信息,请在下面找到 WordPress 文档: https ://docs.bitnami.com/aws/apps/wordpress/
问候
推荐阅读
- java - AirFlow/DAG 中的任务如何找到可执行文件,这些可执行文件实现了任务应该执行的功能?
- graphviz - Dask 自定义图形可视化
- c++ - 在泛型编程中使用placement new
- javascript - 按下回车键时显示 div
- javascript - 试图从 API 中获取,如何仅获取“1”行
- javascript - 如何调试一个 Firefox 扩展?
- python - 创建 2D numpy 数组的最快方法,该数组从 0 开始,在行中增加 1,然后继续到列?
- amazon-s3 - 使用 Exceljs 将文件写入 s3 存储桶
- java - 更改圆形显示动画的颜色
- azure - Azure Devops 部署:解析时任务失败,出现以下错误:JSON 输入意外结束