首页 > 解决方案 > htaccess :将选定的 url 列表从 http 重定向到 https

问题描述

我想 301 重定向所选 http url ( http://hostname.com/oldressource ) 的列表,每一个都指向一个新的 https url ( http://hostname.com/newressource )。

RewriteEngine on 
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R=301]

我有大约 1000 个网址要处理。你能给我一些规则或方法吗?

标签: apache.htaccessserver

解决方案


推荐阅读