ThinkPHP5.0 隐藏index.php入口文件

首先找到web服务的配置文件

AMH  /home/wwwroot/PATH/vhost/domainname.conf

nginx写法

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

然后重启nginx xx/sbin/nginx -s reload

Apache写法

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(Uploads)
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>

同样重启apache服务

猜你喜欢

转载自blog.csdn.net/zxh1220/article/details/80144165
今日推荐