JasonWang Posted April 4, 2014 Share Posted April 4, 2014 (edited) I want to add some new page to display different newsletters and a list of them. And I also dont want to use parameters in the URL, like www.xxx.com/newsletter?id=1. I prefer the way Prestashop do with its product and category. like www.xxx.com/newsletter/1/newsTitle.html But in backoffice, the SEO penal only allow me to add static friendly url, like the 1st kind above. I read some code about how Dispatcher and Controller work in Prestashop. It seems that I just need to add new route rules in Dispatcher->default_routes, and all problems solved. (I already created the newsletterController, and for the URL www.xxx.com/newsletter, it works fine.) the code to add is like: 'newsletter_rule' => array( 'controller' => 'newsletter', 'rule' => 'newsletter/{id}/{rewrite}', 'keywords' => array( 'id' => array('regexp' => '[0-9]+', 'param' => 'id_newsletter'), 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), ), is it correct? Edited April 4, 2014 by JasonWang (see edit history) Link to comment Share on other sites More sharing options...
RedShanks Posted September 17, 2014 Share Posted September 17, 2014 (edited) Hello, i have same probleme. any idea ?? Edited September 17, 2014 by RedShanks (see edit history) Link to comment Share on other sites More sharing options...
otiz Posted April 8, 2015 Share Posted April 8, 2015 You have solution yet? Link to comment Share on other sites More sharing options...
dks295 Posted July 15, 2015 Share Posted July 15, 2015 (edited) using this hook "ModuleRoutes". I can set the new rule like this public function hookModuleRoutes() { $routes = array(); $routes['profile_rule'] = array( 'controller' => 'profile', 'rule' => '{profile_name}', 'keywords' => array( 'profile_name' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'profile_name'), 'rewrite' => array('regexp' => '[_a-zA-Z0-9\pL\pS-]*'), 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), ), 'params' => array( 'fc' => 'module', 'module' => 'demomodule' ) ); return $routes; } so it display the url like https://www.example.com/demoprofile link is working but the other prestashop pages like my account and index page gone blank after header. Is anyone got the solution of this issues? Edited July 15, 2015 by dks295 (see edit history) Link to comment Share on other sites More sharing options...
latt13 Posted December 11, 2018 Share Posted December 11, 2018 Bump, still looking for someting similar Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now