|
(1) 开启伪静态规则: nginx如下
- location / {
- # This try_files directive is used to enable SEO-friendly URLs for OpenCart
- try_files $uri $uri/ @opencart;
- # 隐藏index.php
- if (!-e $request_filename) {
- rewrite ^/(.*)$ /index.php?$1 last;
- }
- }
-
- location @opencart {
- rewrite ^/(.+)$ /index.php?_route_=$1 last;
- }
复制代码
(2) 自定义伪静态列表文件 位置:
catalog/routes.php
支持多参数:'/product/{path}/{product_id}.html'=>'product/product/index',
控制器将接受 GET参数path与product_id用户访问的举例:/product/5-35/1625.html
|
|