亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

iis-ssl certificate - thinkphp configures ssl to force https access. How to remove the index.php suffix?
我想大聲告訴你
我想大聲告訴你 2017-05-16 13:09:33
0
2
1026

How to remove the index.php suffix when configuring SSL in thinkphp to force https access?

In Alibaba Cloud IIS7.5 environment, http is configured to rewrite to https

But after entering http://www.xxx.com, it will be redirected to https://www.xxx.com/index.php/

How to remove this index.php???

我想大聲告訴你
我想大聲告訴你

reply all(2)
左手右手慢動(dòng)作

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