Apache 如何把;及;及;或;条件在二级吗?
这是我当前的Apache 如何把;及;及;或;条件在二级吗?,apache,.htaccess,http,url,mod-rewrite,Apache,.htaccess,Http,Url,Mod Rewrite,这是我当前的VirtualHost节点: <VirtualHost *:80> ServerName abc.com ServerAlias abc.com www.abc.com RewriteEngine on RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/ [NC,R,L] </VirtualHost> 服务器名abc.com ServerAlias
VirtualHost
节点:
<VirtualHost *:80>
ServerName abc.com
ServerAlias abc.com www.abc.com
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/ [NC,R,L]
</VirtualHost>
服务器名abc.com
ServerAlias abc.com www.abc.com
重新启动发动机
重写cond%{HTTPS}=在…上
重写规则^/?(*)https://%{SERVER_NAME}/[NC,R,L]
它表示,每个到达此服务器的请求:80将重定向到HTTPS
。现在我想将或
和和
条件添加到VirtualHost
节点。因此,它将按如下方式工作:
- 如果请求:80来自xyz.com,则不会重定向到
HTTPS
- 如果请求:80来自abc.com,则它将重定向到
HTTPS
RewriteCond %{HTTP_HOST} ^(www\.)?abc\.com$ [NC]
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*)$ https://%{HTTP_HOST}/$1 [NE,R,L]
RewriteCond %{HTTP_HOST} ^(www\.)?xyz\.com$ [NC]
RewriteCond %{HTTPS} on
RewriteRule ^/?(.*)$ http://%{HTTP_HOST}/$1 [NE,R,L]
我以为你想强制avc.com使用https