【发布时间】:2014-12-28 05:21:50
【问题描述】:
我刚刚使用以下 htaccess 重写规则将我的网站从 http 重定向到 https
我的网站位于 public_html 下的文件夹中。假设文件夹名称为“mySitefolderName”
RewriteCond %{HTTP_HOST} ^mysite\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.com$
RewriteRule ^/?$ "https\:\/\/www\.mysite\.com\/mySitefolderName\/" [R=301,L]
通过这条规则,我已经实现了将我的网站从 http 重定向到 https, 但是 Google 上指向“mySitefolderName”下的子目录的旧链接没有被重定向
例如,假设我在 google 上有这个旧链接: mysite.com\mySitefolderName\someSitePage.php
如果我从谷歌点击这个链接,它仍然会继续使用 http
我应该如何确保所有指向子目录的旧链接也都重定向到 https ?
【问题讨论】: