nginx 配置URL重写(实现隐藏index.php)

正则方式:


location / {
	root html/xxxx/yyyy/;
	index index.php index.html;
	if (  !-e  $request_filename ){
		rewrite(.*) /index.php/$1;
	}
}

/auth/login
index.php?/auth/login

try_files方式:
nginx.conf

location / {
    root html/dddai/public/;
    index index.php index.html;
    try_files $uri /index.php?$uri;
}

猜你喜欢

转载自blog.csdn.net/taotaobaobei/article/details/83107071