iis thinkphp隐藏index.php,thinkphp 隐藏index.php iis apache nginx
這篇文章介紹的內(nèi)容是關(guān)于thinkphp 隱藏index.php iis apache nginx ,有著一定的參考價值,現(xiàn)在分享給大家,有需要的朋友可以參考一下
針對不同的web服務(wù)器,iis7 apache nginx 可以使用不同的方法來進(jìn)行配置
1.iis7 在站點(diǎn)根目錄下添加web.config
添加內(nèi)容<?xml version="1.0" encoding="UTF-8"?>
重啟iis生效
2.apache 在根目錄下添加 .htaccess 添加內(nèi)容:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
重啟apache 生效
3.對于nginx 添加內(nèi)容到站點(diǎn)配置文件,然后重載配置文件生效
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
相關(guān)推薦:
總結(jié)
以上是生活随笔為你收集整理的iis thinkphp隐藏index.php,thinkphp 隐藏index.php iis apache nginx的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php调用c windows,php:
- 下一篇: java增加缓存,java – 如何增