Home >Backend Development >PHP Tutorial >如何动态页面转成伪静态

如何动态页面转成伪静态

WBOY
WBOYOriginal
2016-06-06 20:22:101327browse

如何将动态页面转成伪静态

回复内容:

如何将动态页面转成伪静态

rewrite

举例webserver为nginx
eg:

<code>//规则
rewrite ^(.*)/index-([0-9]+)-([0-9]+).html$ $1/index.php?testid=$2&page=$3 last;</code>

则效果如下

<code>http://xxx.com/test/index-1-1.html
//则rewrite后真正访问的是
http://xxx.com/test/index.php?testid=1&page=1</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn