【问题标题】:drupal force https on multisite多站点上的drupal force https
【发布时间】:2017-06-30 10:10:25
【问题描述】:

我对 drupal 多站点设置有疑问。我在同一个 drupal 安装中有 4 个网站: www.example.com/fr, www.example.es, www.example.it, www.example.be/fr 我在 htaccess 文件中应用了常见的 https 重定向规则:

 RewriteEngine on
 RewriteCond %{HTTPS} off
 RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

所有以“/fr”结尾的域都很好用。对于其他人,域主页仍在 http 中,其他 url 工作得很好。那是我的问题。 如何使所有域工作(最后有或没有 /fr)。 请帮帮我。

【问题讨论】:

  • 1.注意不要查看缓存结果,禁用/清除浏览器缓存或进行“深度重新加载”。
  • 2.确保实际上为不同的主机启用了动态配置文件的解释(请参阅AllowOverride 指令)。
  • 3.考虑将此类规则放在 http 服务器主机配置中,而不是使用动态配置文件。为什么这是首选位置的各种原因。
  • arkascha,缓存已经清除,我总是在私人导航中测试规则,仍然无法正常工作。

标签: .htaccess https drupal-7


【解决方案1】:

尝试添加以下内容 参考:d7 multisite

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} ^/site1
RewriteRule ^ site1/index.php [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} ^/site2
RewriteRule ^ site2/index.php [L]

还有:

您可以在文件sites/site.php中修改站点名称

同时使用站点的凭据更新 settings.php 文件。

还需要从主机设置中更新站点 url

【讨论】:

    【解决方案2】:

    以下解决方案适用于 d7 multisits

    在 .htaccess 中包含以下行

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    </IfModule>
    

    参考 - https://forums.cpanel.net/threads/http-to-https-redirects-for-drupal-multisite-setup.606891/

    【讨论】:

      猜你喜欢
      • 2011-09-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多