【发布时间】:2015-11-23 21:29:35
【问题描述】:
对不起,如果这个问题已经发布但我搜索了两次。
我想将我的 http:// 域重定向到 https:// 并且还
http:// example.com/home 或 http:/ /www.example.com/home 到
https://example.com/home
我用谷歌搜索,但不明白哪一种是完美的重定向方式。 我使用这个工作,但只有当一个人访问 http,如果有人直接打开 https 而不是收到错误 此页面有太多重定向
.ht访问代码
Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)
http://www.newdomain.com%{REQUEST_URI} [R=302,NC]
我认为这是旧域到新域,但我不想重定向到另一个域。 将 http 重定向到 https 的域相同。 请解决这个问题
【问题讨论】:
标签: php apache .htaccess mod-rewrite redirect