BUG是程序员晋级的灵石!
知识点
1.在apache 常规坏境下隐藏index.php
2.在apache phpstudy隐藏index.php
3.Nginx下隐藏index.php
注意:这里不讲iis下的隐藏
版本:thinkphp5.07
本方法同样适用于wamp2.4 (注意:wamp2.5 apache语法规则有变化,因为apache版本比较高),xampp等环境。
~~~
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
//如果以上方法不成立,可以尝试下面的方法(高版本apache)
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [QSA,PT,L]
~~~
~~~
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
~~~
~~~
location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
~~~