ecstore b2b2c 商城页面伪静态代码 及相关注意事项

一下代码需要添加到 nginx.conf配置文件的server块,阿里云虚拟机一般在conf文件夹下建立vhost文件夹,把server块放进去,然后

在nginx.conf使用include 包含进去:格式如下:include vhost/xx.conf。

当然使用伪静态要记的在 网站config/config.php 把伪静态开关打开,如下:

原来的:
define('WITH_REWRITE',false);

需要修改成:

define('WITH_REWRITE',true);

以下为ecstore伪静态完美解决代码:

 1 location / {
 2     if (!-e $request_filename) {
 3       rewrite ^/(.*)$ /index.php/$1 last;
 4     }
 5     index index.php index.htm index.html;
 6 }
 7 location ~ ^/shopadmin {
 8     rewrite  ^/(.*)$  /index.php/$1 last;
 9     break;
10 }

其他:

我在操作中,由于重启了虚拟机,导致打开首页502 bad getaway 错误,经查证是没有启动php-fpm 进程,启动接口正常打开首页。

用到的命令:

启动php-fpm:

usr/local/nginx/php/php-fpm

nginx服务器命令:

service nginx stop

service nginx start

service nginx reload

nginx -c 配置文件地址 
原文地址:https://www.cnblogs.com/netsa/p/5607788.html