大米CMS官网论坛,大米站长联盟,大米站长之家,大米开发者社区

标题: damishop伪静态自定义路由的使用 [打印本页]

作者: 追影    时间: 2022-12-1 16:53
标题: damishop伪静态自定义路由的使用
(1) 开启伪静态规则: nginx如下
  1.               location / {
  2.                 # This try_files directive is used to enable SEO-friendly URLs for OpenCart
  3.                 try_files $uri $uri/ @opencart;
  4.                 # 隐藏index.php
  5.                 if (!-e $request_filename) {
  6.                     rewrite  ^/(.*)$ /index.php?$1 last;
  7.                 }
  8.               }
  9.             
  10.               location @opencart {
  11.                 rewrite ^/(.+)$ /index.php?_route_=$1 last;
  12.               }
复制代码



(2) 自定义伪静态列表文件 位置:
catalog/routes.php
支持多参数:'/product/{path}/{product_id}.html'=>'product/product/index',
控制器将接受 GET参数path与product_id用户访问的举例:/product/5-35/1625.html







欢迎光临 大米CMS官网论坛,大米站长联盟,大米站长之家,大米开发者社区 (https://www.damicms.com/bbs/) Powered by Discuz! X3.1