84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
thinkphp 配置ssl 强制https访问时 如何去掉index.php后辍?
阿里云IIS7.5环境下 配置好了http 重写向https
可是输入http://www.xxx.com 后 会重定向到https://www.xxx.com/index.php/
如何去掉这个index.php???
index.php is the entry file of thinkphp
My implementation method
No need to configure iis url rewriting module
Write the following code directly into the thinkphp entry file (iis certificate needs to be configured)
if ($_SERVER['HTTPS'] != "on") { $index = strstr($_SERVER['REQUEST_URI'],"index.php"); if($index){ $str = preg_replace('/\/index.php/', '', $_SERVER['REQUEST_URI']); $url = "https://" . $_SERVER["SERVER_NAME"] . $str; header("location:".$url); } }
index.php is the entry file of thinkphp
My implementation method
No need to configure iis url rewriting module
Write the following code directly into the thinkphp entry file (iis certificate needs to be configured)