【问题标题】:Force web root to use http强制 web root 使用 http
【发布时间】:2013-07-31 00:39:56
【问题描述】:

我设置了一些重写来强制网站的一半页面使用 http 和一半 https。这一切都有效,包括https://site.com/index.php,但只是https://site.com 不会重写为http。

RewriteCond %{SERVER_PORT} 443
RewriteRule ^about\.php|contact\.php|down\.php|faq\.php|find\.php|forgot\.php|home\.php|index\.php|listings\.php|viewpost\.php$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

如何编辑它以包含根目录?我试过添加 /|条件,但这没有帮助

【问题讨论】:

    标签: .htaccess http mod-rewrite


    【解决方案1】:

    原来我只需要一个不带斜线的管道

    RewriteRule ^|about\.php|contact\.php|down\.php|faq\.php|find\.php|forgot\.php|home\.php|index\.php|listings\.php|viewpost\.php$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    

    【讨论】:

      猜你喜欢
      • 2013-10-14
      • 1970-01-01
      • 2016-03-23
      • 2011-09-12
      • 1970-01-01
      • 1970-01-01
      • 2015-06-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多