使别名免受重写规则

我有以下的Apacheconfiguration:

<VirtualHost *:80> Alias "/.well-known" "/var/www/example.com/.well-known" RewriteEngine On <If "%{HTTP_HOST} == 'example.com'"> RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </If> <ElseIf "%{HTTPS} != 'on'"> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </ElseIf> </VirtualHost> 

我希望Alias免于HTTPSredirect,即http://example.com/.well-known/x应该返回/var/www/example.com/.well-known/x文件。 目前,它正在通过下面的RewriteRulesredirect到HTTPS。

我怎样才能使Alias免受redirect?

 <If "%{HTTP_HOST} == 'example.com' && !(${REQUEST_URI -strcmatch '/.well-known/*')" > RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </If> <ElseIf "%{HTTPS} != 'on' && !(${REQUEST_URI -strcmatch '/.well-known/*')"> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </ElseIf>