在相应nginx配置文件的server中,添加如下代码
rewrite ^/(.*)-htm-(.*)$ /$1.php?$2;
系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
例如:
vi /usr/local/nginx/conf/nginx.conf #编辑nginx配置文件
找到下面这行,在server_name localhost;后边一行添加上面的代码
server { listen 80; server_name localhost; rewrite ^/(.*)-htm-(.*)$ /$1.php?$2; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.php index.html index.htm; }
系统运维 www.osyunwei.com 温馨提醒:qihang01原创内容©版权所有,转载请注明出处及原文链接
保存配置文件,最后重启nginx即可
service nginx restart
然后在phpwind论坛后台-全局-伪静态-静态目录部署-静态目录部署功能,选择开启。
静态目录:-htm-
静态目录扩展名设置:.html
点击提交即可

» 转载请注明来源:系统运维 » Linux环境下phpwind论坛nginx伪静态规则设置


