访问静态网页时隐藏网页后缀

在伪静态中添加如下代码即可:

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

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注