Ecstore伪静态配置

  • 在nginx.conf的 server配置中加入如下代码
    if ($request_uri ~ (.+?\.php)(|/.*)$ ){
        break;                                                                                                                                  
    }
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php/$1 last;
    }
    
    配置完成后需重启nginx
    
  • 修改ecstore的config配置,代码如下
    define('WITH_REWRITE',true);
    
  • 我自己的nginx.conf文件,仅供参考
    user  www www;
    worker_processes  1;
    events {
        worker_connections  1024;
    }
    http {
        include       mime.types;
        index  index.php index.html index.htm;
        root   /data/www;
    
        default_type  application/octet-stream;
        sendfile        on;
        keepalive_timeout  65;
        server {
            listen       80;
            server_name  192.168.51.67;
            if ( $host ~* (.*)\.(.*)\.(.*)){
                set $domain $1;
            }
    
            location ~ ^/(.*)/data/.*\.(php)?$
            {
                return 404;
                deny all;
            }
    
            location ~ ^/(.*)/public/.*\.(php)?$
            {
                return 404;
                deny all;
            }
    
            location ~ ^/(.*)/themes/.*\.(php)?$
            {
                return 404;
                deny all;
            }
    
            location ~ ^/(.*)/wap_themes/.*\.(php)?$
            {
                return 404;
                deny all;
            }
    
            #伪静态配置
            if ($request_uri ~ (.+?\.php)(|/.*)$ ){
                break;                                                                                                                                  
            }
            if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 last;
            }
    
            location / {
                autoindex  on;
                send_timeout 1800;
                fastcgi_buffers 8 128k;
            }
            error_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   html;
            }
    
            location ~ \.php {
                include        fastcgi_params;
                set $real_script_name $fastcgi_script_name;
                set $path_info "";
                set $real_script_name $fastcgi_script_name;
                if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") {
                    set $real_script_name $1;
                    set $path_info $2;
                }
                fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
                fastcgi_param SCRIPT_NAME $real_script_name;
                fastcgi_param PATH_INFO $path_info;
                fastcgi_pass   127.0.0.1:9000;
                fastcgi_index  index.php;
            }
    
    
        }
    
    }
    

內容目录

上一个主题

ecstore安装

下一个主题

mongodb安装

快速搜索

输入相关的模块,术语,类或者函数名称进行搜索