当前位置:网站首页 / 建站 / 正文

nginx配置二级目录网站的伪静态

时间:2017年05月26日 | 作者 : liuhui | 分类 : 建站 | 浏览: 8048次 | 评论 1

阿里云限量代金券 | 此广告位出租25元/月

1.gif

因为业务需求,需要在网站的二级目录下建立一个新站点shumei,新站点也要用url重写的方式访问,比如www.diannaobos.com/shumei/.......。试着配置了一下nginx的重写规则,如下:

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

location /shumei/ {
index index.php index.html;
	if (!-e $request_filename)
	{
		rewrite ^/shumei/(.*)$ /shumei/index.php last;
	}
}


推荐您阅读更多有关于“”的文章

猜你喜欢

网站分类
关注电脑博士
友情链接

分享:

支付宝

微信