zoukankan      html  css  js  c++  java
  • 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 配置文件地址 
  • 相关阅读:
    LAMP搭建示例
    MySQL主从
    list多字段去重
    mysql按照某一个条件进行分组统计,同时又要保证一个相同字段的数据只统计一次
    sentinel自定义异常处理
    sentinel规则持久化
    zookeeper
    shiro
    iframe之间传递参数
    自定义标签
  • 原文地址:https://www.cnblogs.com/netsa/p/5607788.html
Copyright © 2011-2022 走看看