Adib Aroui Posted June 19, 2020 Share Posted June 19, 2020 (edited) I am building a front module for a website that is using `301 Moved Permanently` option in `SEO and URLs` configuration. Wesbite uses Prestashop 1.6.1.9. In module, I am defining the route like this: public static $ModuleRoutes = array( 'module-aacategories-viewmapping-mapping' => array( 'controller' => 'viewmapping', 'rule' => 'mappings{/:tree}', 'keywords' => array( 'tree' => array('regexp' => '[/_a-zA-Z0-9-\pL]*', 'param' => 'tree'), ), 'params' => array( 'fc' => 'module', 'module' => 'aacategories', ) ) ); In browser address bar, when I enter: Quote site.local/en/mappings/test-map/first-test I get: Quote Please use the following URL instead: site.local/en/index.php?controller=viewmapping&tree=test-map%2Ffirst-test&module=aacategories This latter link gives 404. However, when I append `&fc=module` to the url, it goes to desired page. The problems: 1- How to force Prestashop routing to append `&fc=module` at the end? 2- How to keep the friendly url in address bar and not be redirected? Note: When I change configuration in SEO and URLs to no redirection, then it works. But it is not the configuration needed in prod. Your help is much appreciated. Thanks in advance. Edited June 19, 2020 by Adib Aroui (see edit history) Link to comment Share on other sites More sharing options...
Adib Aroui Posted June 19, 2020 Author Share Posted June 19, 2020 (edited) I was mistakenly declaring $php_self property in my module front controller. This property is used in FrontController.php to decide which is the URL. Thanks for your time guys. Edited June 19, 2020 by Adib Aroui (see edit history) 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