我不想仅将一个URL重定向到https和www。我只想要cdn.example.com网址。
RewriteCond %{HTTPS} =on
RewriteCond cdn.example.com
RewriteRule http://cdn.example.com/ [R=301,L]
用于在所有页面上添加www
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
对于https
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
但是我不想将“ cdn.example.com” URL重定向到https和www 我只想要http://cdn.example.com/