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