700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > iis thinkphp隐藏index.php thinkphp 隐藏index.php iis apache nginx

iis thinkphp隐藏index.php thinkphp 隐藏index.php iis apache nginx

时间:2021-05-12 18:12:04

相关推荐

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;

}

}

相关推荐:

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。