【问题标题】:Redirecting Subdir to HTTPS将子目录重定向到 HTTPS
【发布时间】:2013-05-12 12:34:11
【问题描述】:

我有一个站点 mydomain.com/secure,我只想通过 HTTPs 访问它。这被映射为这样的虚拟目录:

-wwwroot
--secure (Virtual directory, bound on port 443 only) - https://mydomain.com:443/secure
--externalApp (Mapped as a different site on port 80) - http://mydomain.com/

目前已提供对 mydomain.com/secure 的请求,但我想强制它们重定向到 HTTP。尽管尝试使用重写规则,但我无法使其正常工作。是可行还是不可行?

【问题讨论】:

    标签: iis ssl iis-7 rewrite url-redirection


    【解决方案1】:

    试试这个:

    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(example|secure|test) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
    

    您可以在示例|安全|测试区域中添加任何您想要的目录。

    Example with comments.

    【讨论】:

      猜你喜欢
      • 2019-07-20
      • 1970-01-01
      • 2016-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-10
      • 2015-10-08
      相关资源
      最近更新 更多