网址重写 - magento - nginx:未找到类别404但适用于产品

时间:2014-08-12 05:26:09

标签: php magento-1.9

您好我一直在尝试使用magento,因为几天和我的网址重写类别似乎不起作用(但对于产品有效)。这是重写管理:

enter image description here

第一个不起作用(404),其余的(2和3)都有效。

404未找到burung.html

enter image description here

但对于它有效的产品:

enter image description here

这是我的虚拟主机:

server {
  listen      80;
  server_name store.mockie;
  root        /home/mockie/projects/store.mockie/magento;
  index       index.html index.htm index.php;

  location / {
    index index.html index.php; 

## If missing pass the URI to Magento's front handler
    try_files $uri $uri/ @handler; 
    expires max; ## Enable max file cache
  }

## These locations need to be denied
    location ^~ /app/                { deny all; }
    location ^~ /includes/           { deny all; }
    location ^~ /lib/                { deny all; }
    location ^~ /media/downloadable/ { deny all; }
    location ^~ /pkginfo/            { deny all; }
    location ^~ /report/config.xml   { deny all; }
    location ^~ /var/                { deny all; }

## Allow admins only to view export directory
## Set up the password for any username using this command:
## htpasswd -c /etc/nginx/htpasswd magentoadmin

    location /var/export/ { 
        auth_basic           "Restricted";
        auth_basic_user_file htpasswd; ## Defined at /etc/nginx/htpassword
        autoindex            on;
    }


## Disable .htaccess and other hidden files
    location  /. { 
        return 404;
    }

## Magento uses a common front handler 
    location @handler { 
        rewrite / /index.php;
    }

## Forward paths like /js/index.php/x.js to relevant handler
    location ~ .php/ { 
        rewrite ^(.*.php)/ $1 last;
    }

  location ~ \.php$ {


## Catch 404s that try_files miss
    if (!-e $request_filename) { rewrite / /index.php last; } 

## Disable cache for php files
    expires        off;

    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include        fastcgi_params;

## Store code is located at Administration > Configuration > Manage Stores in your Magento Installation.
    fastcgi_param  MAGE_RUN_CODE default; 
    fastcgi_param  MAGE_RUN_TYPE store;

## Tweak fastcgi buffers, just in case.
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;


  }
}

1 个答案:

答案 0 :(得分:0)

关于第一个链接(burung.html),类别URL可能包含在路径或完整URL中。正确的链接可能是/category/burung.html。可以在Magento配置中配置类别URL设置。这就是我先要检查的内容。