【发布时间】:2018-05-05 07:16:40
【问题描述】:
我目前正在强制访问者通过 https 访问我的所有网站(主要是 Wordpress),我使用以下代码:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
现在我想知道是否可以使用 if is not 语句,所以如果我在本地环境中工作,这将不起作用。例如:
<If "%{HTTP_HOST} != 'http://localhost:8888'">
# live configuration
</If>
<Else>
# local configuration
</Else>
最好的方法是什么? 谢谢提前!
【问题讨论】: