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

时间:2023-03-09 17:32:34
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伪静态完美解决代码:

 location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
}
index index.php index.htm index.html;
}
location ~ ^/shopadmin {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}

其他:

我在操作中,由于重启了虚拟机,导致打开首页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 配置文件地址