Home >Backend Development >PHP Tutorial >thinkphp hide index.php iis apache nginx

thinkphp hide index.php iis apache nginx

不言
不言Original
2018-04-16 09:55:062274browse

这篇文章介绍的内容是关于thinkphp 隐藏index.php iis apache nginx  ,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下

针对不同的web服务器,iis7 apache nginx 可以使用不同的方法来进行配置

1.iis7 在站点根目录下添加web.config

添加内容

930406f08da8ee4a2ff134b688d29d1d

f9d9f4a8f32d97f3ef0c10742ed31240

  1dcc4c920d99d48189de261dfba48f61

378304a057eaf72a94c950d969eebaea

 d73c95a855a8598744886b6e660364b1

d080c96c577f7f5d1db1a4e437bc780c

 aa8e6f1326100fb5180107af9f5abc75

 b659bb58dbe275a38ad6787a745beaad

72a6dffa1786ef8ae2d34a116cbe2221

698693bebf4085d80104474585704ac7

d743fc31c1fe81c82d2657e1aa2391ab

 acaf4227375b168cb45e310458920cb9

 90c8b5f72f5697639c04778f8b2fb3e3

a58ab567b613e693f3c812dd91b5386a

 ffff1b6059a14b025478b9886ca4cfd7

76ea79f81f2a1c70e18f05c4a4aef549

  8949b9d1274f3c945159f8136aaa1284

4b1b9d85fe86862ae3eab7e2045cf8a0

重启iis生效

 

2.apache 在根目录下添加 .htaccess 添加内容:

accc8b222b481b6a3bae338f95f68faf

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

 2071f931c9870be1bebed0bdda8305e7

重启apache 生效

 

3.对于nginx 添加内容到站点配置文件,然后重载配置文件生效

  1. location / { 
       if (!-e $request_filename) {
       rewrite  ^(.*)$  /index.php?s=$1  last;
       break;
        }
     }

 相关推荐:

thinkphp隐藏index.php/home,并允许访问其他模块

thinkphp隐藏中url的index.php,thinkphpindex.php_PHP教程

 

The above is the detailed content of thinkphp hide index.php iis apache nginx. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn