【发布时间】:2014-02-04 06:02:09
【问题描述】:
我正在使用安全组件 forcesl 在整个网站中强制使用 https。
对于https://www.domain.com/pages/detail/terms,在.htaccess文件中,我重写规则如下
RewriteRule ^(terms)$ pages/detail/$1/ [L]
所以它应该重定向到 https://www.domain.com/terms。
当使用 https://domain.com/terms 访问术语页面时,它会重定向到 https://www.domain.com/terms。
当使用http://domain.com/terms 访问条款页面时,它会重定向到 https://www.domain.com/pages/detail/terms。
这是因为控制器中的forcessl:
$this->redirect('https://' . $_SERVER['SERVER_NAME'] . $this->here);
$this->here
指向原始页面(页面/详细信息/条款)。如何解决这个问题。
【问题讨论】: