【问题标题】:htaccess rewrite to https if not xml file and not containing display in request URI如果不是 xml 文件并且不包含请求 URI 中的显示,则 htaccess 重写为 https
【发布时间】:2016-07-18 06:09:35
【问题描述】:

如何为非xml文件请求以及当请求URI不包含字符串“display”时创建htaccess重写规则到https?

我尝试了以下方法,但这不起作用:

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !xml [NC,OR]
RewriteCond %{REQUEST_URI} !display [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

谢谢。

【问题讨论】:

  • 你的问题到底是什么?

标签: xml string .htaccess url-rewriting contain


【解决方案1】:

用途:

RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !xml [NC]
RewriteCond %{REQUEST_URI} !display [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,NE,R=301]

因为它是AND而不是OR

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-31
    • 2013-11-19
    • 1970-01-01
    • 2013-01-25
    • 1970-01-01
    • 1970-01-01
    • 2018-04-05
    • 1970-01-01
    相关资源
    最近更新 更多