Nginx实现伪静态页面

1、虚拟页面

/entries/mb_1_2_3.htm

2、真实地址

/entries?class=1&mod=2&action=3

3、重写规则

rewrite "(.*)/mb_([a-zA-Z0-9]+)_([a-zA-Z0-9]*)[_]?([a-zA-Z0-9]+)?.htm$" $1?class=$2&mod=$3&action=$4? last;

扫描二维码关注公众号,回复: 1345340 查看本文章

这样可以一定程度上防止url伪造攻击。

猜你喜欢

转载自eric-gao.iteye.com/blog/1154730