iis-ssl证书 - thinkphp 配置ssl 强制https访问时 如何去掉index.php后辍?
我想大声告诉你
我想大声告诉你 2017-05-16 13:09:33
0
2
864

thinkphp 配置ssl 强制https访问时 如何去掉index.php后辍?

阿里云IIS7.5环境下 配置好了http 重写向https

可是输入http://www.xxx.com 后 会重定向到https://www.xxx.com/index.php/

如何去掉这个index.php???

我想大声告诉你
我想大声告诉你

reply all (2)
左手右手慢动作

index.php is the entry file of thinkphp

    phpcn_u1582

    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); } }
      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!