apache
把如下代码写一个.htaccess,丢到/abc/里面
RewriteEngine on
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)?$ https://%{SERVER_NAME}/abc/$1 [L,R]
nginx
配置文件里写
location /abc/ {
if ( $scheme = 'http' ) {
rewrite ^(.*)$ https://$host$1 permanent;
}
}
Leave a Reply