如何将所有 SSL 请求重定向到“https”文件夹?我的前端 Web 服务器是 nginx。
例如:
https://website.com/checkout.php 应重定向至https://website.com/https/checkout.php
请帮我解决这个问题。
答案1
在服务器 {} 块中
rewrite ^/checkout.php$ https://website.com/https/checkout.php permanent;
答案2
location / {
rewrite ^ https://website.com/https$request_uri permanent;
}
location /https {
// Whatever you normally do
}