mrthrust Posted July 25, 2019 Share Posted July 25, 2019 (edited) Hi guys... Like the title says, My module front controller produces a 404, even though the SEO URL has been set in B.O... I built the module on localhost (xampp) using a full copy of the production site (prestashop 1.6.0.8).. everything works great on the local setup, install & un-install works a treat... but... as soon as I load the module on the production site the friendly URL generates the 404 error, I've tried other development servers & had the same results, I just cant for the life of me figure out why the module produces the 404.. I've tried ... disabling/enabling the friendly urls, deleted htaccess & re-generated changed module controller name, uppercase, lowercase.. before / after install, deleted "cache_index.php" removed the record from the SEO URL table & created another with different name, cleared all browser cookies, tried other browsers. enabled _PS_MODE_DEV_ enabled _PS_DEBUG_PROFILING_ still getting the 404 while on production MODULE - /modules/MYCheckins/MYCheckins.php class MYCheckins extends Module { protected $config_form = false; public function __construct() { $this->name = 'MYCheckins'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'MartyG'; $this->need_instance = 1; $this->dbTable = 'my_checkins'; $this->maxRows = 50; $this->maxImgWidth = 380; $this->maxImgHeight = 400; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('My Checkins'); $this->description = $this->l('my checkin mapping tool.'); $this->confirmUninstall = $this->l('Are you sure you would like to uninstall this module?'); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99'); } public function install() { .. } ... } CONTROLLER - MYCheckins/controllers/front/checkin.php class MYCheckinsCheckinModuleFrontController extends ModuleFrontController { // commented out, didnt seem to do anything? // tried with & without still the same.. //public $php_self = "checkin"; public function init() { parent::init(); // SEO META $this->context->smarty->tpl_vars['meta_title']->value = Configuration::get('MYCHECKIN_META_TITLE'); $this->context->smarty->tpl_vars['meta_description']->value = Configuration::get('MYCHECKIN_META_DESC'); // DISABLE SIDEBARS $this->display_column_left = false; $this->display_column_right = false; } public function initContent() { parent::initContent(); ...(lots of other code, checking records, getting config values) // load the template $this->setTemplate('checkin.tpl'); } public function postProcess() { // check form submission if( Tools::isSubmit() )... // do validation, // insert to db // send email // show template $this->setTemplate('complete.tpl'); } } Like I mentioned the module works great on my local system & production... I can load up the module controller using the standard linkhttps://www.site.com/index.php?fc=module&module=MYCheckins&controller=checkin but the url should be https://www.site.com/checkin But this still generates that 404 output... Localhost: PHP Version 5.6.21Production: PHP Version 5.4.45 (could this cause any issues) is there anything else I should try..? Edited July 25, 2019 by mrthrust php versions (see edit history) Link to comment Share on other sites More sharing options...
mrthrust Posted July 31, 2019 Author Share Posted July 31, 2019 bump!.... Still having this issue, I've tried the module on various servers now with the same results, I can access the module page from 2 different url's, but never the friendly URL.... https://www.site.com/index.php?fc=module&module=MYCheckins&controller=checkin https://www.site.com/module/MYCheckins/checkin but never... https://www.site.com/checkin Link to comment Share on other sites More sharing options...
Mahdi Shad Posted April 22, 2021 Share Posted April 22, 2021 You have to use "moduleRoutes" hook in your module 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