在Apache虚拟主机配置文件中添加以下代码:
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteCond %{REQUEST_URI} !^/exclude_path(/.*)?$ [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
在上面的代码中,/exclude_path是特定路径,您可以将其更改为您的特定路径。此代码将在请求URI不包含/exclude_path时禁用HTTPS重定向。