Routes 从URI中删除FireSALE-路由问题

Routes 从URI中删除FireSALE-路由问题,routes,pyrocms,Routes,Pyrocms,我已经在PyroCMS中安装了模块FireSALE 我想从URI中删除“FireSale”,或者如果可能,将其更改为自定义字符串。 i、 e 到 您可以在main routes.php(system/cms/config/routes.php)中完成它 $route['category/(order|layout)/([0-9]+)'] = 'firesale/front_category/$1/$2'; $route['category(:any)'] =

我已经在
PyroCMS
中安装了模块
FireSALE

我想从URI中删除“FireSale”,或者如果可能,将其更改为自定义字符串。 i、 e


您可以在main routes.php(system/cms/config/routes.php)中完成它

$route['category/(order|layout)/([0-9]+)'] = 'firesale/front_category/$1/$2';
$route['category(:any)']                   = 'firesale/front_category/index$1';
$route['product(:any)']                    = 'firesale/front_product/index$1';
$route['search(:any)?']                    = 'firesale_search/search/index$1';
$route['cart(:any)?']                      = 'firesale/cart$1';
要做到这一点而不发生冲突(如domain.com/blog等其他模块uri),最好的方法是在routes.php中放置类似下面的代码

$route['category/(order|layout)/([0-9]+)'] = 'firesale/front_category/$1/$2';
$route['category(:any)']                   = 'firesale/front_category/index$1';
$route['product(:any)']                    = 'firesale/front_product/index$1';
$route['search(:any)?']                    = 'firesale_search/search/index$1';
$route['cart(:any)?']                      = 'firesale/cart$1';

另外,将默认控制器从pages更改为firesale(可选)

当前可接受的方法是使用路由。 除了使用路由,您还可以实际重命名模块。这可以使用脚本完成。这可以有效地将模块的路径更改为所需的路径。 e、 g:可以将“博客”重命名为“文章”

Linux:

OSX:

$route['category/(order|layout)/([0-9]+)'] = 'firesale/front_category/$1/$2';
$route['category(:any)']                   = 'firesale/front_category/index$1';
$route['product(:any)']                    = 'firesale/front_product/index$1';
$route['search(:any)?']                    = 'firesale_search/search/index$1';
$route['cart(:any)?']                      = 'firesale/cart$1';