首页 > 代码库 > zencart搜索结果页面静态化 advanced_search_result

zencart搜索结果页面静态化 advanced_search_result

首先,确认网站是否安装了ultimate_seo_urls 伪静态模块。

修改include/classes/seo.url.php

大约126行添加代码

‘keyword‘ => ‘sale‘

大约201行添加代码

case FILENAME_ADVANCED_SEARCH_RESULT:

$link .= "index.php?main_page=advanced_search_result";

break;

大约456行添加代码

case ‘keyword‘:

switch(true){

case ($page == FILENAME_ADVANCED_SEARCH_RESULT):

$url = $this->make_url($page,"", $p2[0], $p2[1], ‘.html‘, $separator);

break;

default: $container[$p2[0]] = $p2[1];

break;

}

break;

.htaccess文件中添加规则

RewriteRule ^(.*).html$ index\.php?main_page=advanced_search_result&keywords=$2&%{QUERY_STRING} [L]