1. 首页
  2. 网站建设

LNMP环境下易思ESPCMS伪静态设置

espcms易思企业网站管理系统安装包内默认只提供.htaccess的配置,那么怎么让这个程序在lnmp下也支持伪静态呢?有一个网站可以把.htaccess转成nginx支持的格式,网址:http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ 。但是如果把转换后的格式直接拿来使用,章郎虫测试后发现还是错误的。所以这里把我修改后的配置文件和大家分享下。经过测试,绝对可用。

rewrite ^/([w/]*)(article)_(list)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&tid=$4 last;
rewrite ^/([w/]*)(article)_(read)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&did=$4 last;
rewrite ^/([w/]*)(article)_(read)_([0-9]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&did=$4&page=$5 last;
rewrite ^/([w/]*)(special)_(list)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?page=$5&ac=$2&at=$3&sid=$4 last;
rewrite ^/([w/]*)(search)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(messmain)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&did=$4 last;
rewrite ^/([w/]*)(messmain)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(form)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&fgid=$4 last;
rewrite ^/([w/]*)(order)_([a-zA-Z]+).([html]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(order)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&did=$4 last;
rewrite ^/([w/]*)(ordermain)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(ordermain)_(list)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?page=$5&ac=$2&at=$3 last;
rewrite ^/([w/]*)(ordermain)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&oid=$4 last;
rewrite ^/([w/]*)(enquiry)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(enquiry)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&did=$4 last;
rewrite ^/([w/]*)(enquirymain)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(enquirymain)_(list)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?page=$5&ac=$2&at=$3 last;
rewrite ^/([w/]*)(enquirymain)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&eid=$4 last;
rewrite ^/([w/]*)(forum)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(forum)_(list)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?page=$5&ac=$2&at=$3&btid=$4 last;
rewrite ^/([w/]*)(forum)_(read)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?page=$5&ac=$2&at=$3&bid=$4 last;
rewrite ^/([w/]*)(forum)_(add)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&btid=$4 last;
rewrite ^/([w/]*)(forummain)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(forummain)_(list)_([0-9]+)[_]*([0-9]*).([a-zA-Z]+)$ $1/index.php?page=$5&ac=$2&at=$3 last;
rewrite ^/([w/]*)(forummain)_([a-zA-Z]+)_([0-9]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&bid=$4 last;
rewrite ^/([w/]*)(public)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(public)_([a-zA-Z]+)_([.0-9a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3&rd=$4 last;
rewrite ^/([w/]*)(member)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;
rewrite ^/([w/]*)(membermain)_([a-zA-Z]+).([a-zA-Z]+)$ $1/index.php?ac=$2&at=$3 last;

联系我们

0574-55011290

QQ:248687950

邮件:admin@nbhao.org

工作时间:周一至周五,9:00-18:00,节假日休息

QR code