2015-07-03 33 views
0

一般我們在WordPress的插件添加重寫URL如下添加自定義重寫規則的Prestashop

function custom_rewrite_basic() { 
    add_rewrite_rule('^leaf/([0-9]+)/?', 'index.php?page_id=$matches[1]', 'top'); 
} 
add_action('init', 'custom_rewrite_basic'); 

什麼是過程添加重寫URL中的Prestashop自定義模塊。 我想在我的自定義模塊中處理url請求。
例如URL請求localhost/prestashop/newpage.php和文件位於localhost/prestashop/modules/mymodules/includes/newpage.php

回答

0

如果您正在使用的prestashop 1.4,你可以插入在後臺>工具自定義規則>發電機

如果您正在使用的Prestashop 1.5或更高版本,可以直接修改.htaccess但你應該在下面的註釋之前加上你的自定義規則

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again 
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution 
# http://www.prestashop.com - http://www.prestashop.com/forums