首页 > 解决方案 > 非 www 到 www 不适用于使用 safari 的 EC2 实例中的 wordpress

问题描述

如果我使用我的 Safari 浏览器,我无法访问我的网站 example.com。我必须使用 www.example.com 才能工作。我尝试多次编辑 htaccess,但仍然无法正常工作。我的网站使用的是托管在 AWS 中的bitami wordpress 图像(https://docs.bitnami.com/ )。

标签: wordpress.htaccessamazon-ec2bitnamino-www

解决方案


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/

问候


推荐阅读