JuanMans Posted January 15, 2020 Share Posted January 15, 2020 (edited) Hello, I have a problem with hitting module endpoints when multi-language option is enabled. One of my Cron jobs tries to hit the URL: https://theshopname.com/es/index.php?controller=do&fc=module... It returns 404 page - not found. When I remove language prefix /es/ and hit endpoint manually: https://theshopname.com/es/index.php?controller=do&fc=module.. It works perfectly. I do not want to remove multi-language support. Is it possible to make it work with the language prefix as well, so the: https://theshopname.com/es/index.php?controller=do&fc=module will also trigger the action instead of returning 404? Thanks for any help! Edited January 15, 2020 by JuanMans formatting (see edit history) Link to comment Share on other sites More sharing options...
selectshop.at Posted January 15, 2020 Share Posted January 15, 2020 You have mod_rewrite activated ? Where exactly are you seeing this links ? The links you are naming are for backend only, but not for front-office. Link to comment Share on other sites More sharing options...
JuanMans Posted January 15, 2020 Author Share Posted January 15, 2020 (edited) mod_rewrite is not activated. One of the modules, which our shop uses, is running Cron jobs to sync inventory - that is why it is backend related - I can see the that link in the logs of the Cron job. Unfortunately I am not able to change it in the Cron job settings, so I wonder if it is possible to enable those backend related link to work with language prefixes like /es/, /en/. To give you a better view: https://theshopname.com/index.php => redirects me to the homepage (301 and redirect to the /en) https://theshopname.com/es/index.php => redirects me to the 404 page Edited January 15, 2020 by JuanMans more details (see edit history) Link to comment Share on other sites More sharing options...
selectshop.at Posted January 15, 2020 Share Posted January 15, 2020 Revert to the developer of the module for the problem you are having. BTW from which Prestashopversion are we talking about ? https://theshopname.com/es/index.php => redirects me to the 404 page, because the page is not available. Perhaps you made changes on the native linking way of Prestashop, or the language is not activated. It would be helpful to know the correct URL of your page to see onsite what is happening with this link. For the other problem you should contact module developer, as these are other links not including languages /en/, /es/, etc.. Link to comment Share on other sites More sharing options...
JuanMans Posted January 15, 2020 Author Share Posted January 15, 2020 (edited) Prestashop version: 1.6.1.17 The response from developer module is "Provider should be able to quickly find and fix the error". As far as I know, there is not an easy & quick way to fix that. We did not make any changes to native way linking of Prestashop. Language is activated - I do not know what you mean here but I am able to see translations etc. Is it possible that SEO friendly links causes such issue? Edited January 15, 2020 by JuanMans format (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted January 15, 2020 Share Posted January 15, 2020 It seems you don't have "Friendly URLs" enabled, so you can't use language prefix the way you are doing. Link to comment Share on other sites More sharing options...
JuanMans Posted January 15, 2020 Author Share Posted January 15, 2020 @joseantgv You can check the attachment. There is a warning but it seems like it enabled. I can see it actually works: It changes 'search' to 'szukaj'. Check attachment for the rule. Link to comment Share on other sites More sharing options...
joseantgv Posted January 15, 2020 Share Posted January 15, 2020 But then you can't mix friendly URLs with "unfriendly URLS". Language prefix is from Friendly URLs and "index.php?controller=do&fc=module..." is from unfriendly URLs. Link to comment Share on other sites More sharing options...
JuanMans Posted January 15, 2020 Author Share Posted January 15, 2020 (edited) Thanks for your help! Let's say that I am going to disable Friendly URL, so how does the multi-language option looks then? Will it work with the /es/index.php?controller=do&fc=module...? Edited January 15, 2020 by JuanMans (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted January 15, 2020 Share Posted January 15, 2020 No! /index.php?id_lang=6&controller=do&fc=module... Link to comment Share on other sites More sharing options...
JuanMans Posted January 15, 2020 Author Share Posted January 15, 2020 @joseantgv I will check it later during maintenance mode. Thanks for your help! I really appreciate it! Link to comment Share on other sites More sharing options...
selectshop.at Posted January 16, 2020 Share Posted January 16, 2020 17 hours ago, JuanMans said: @joseantgv You can check the attachment. There is a warning but it seems like it enabled. I can see it actually works: It changes 'search' to 'szukaj'. Check attachment for the rule. The warning is saying that your server does not have mod_rewrite activated, so it cannot work, cause this is server sided controlled ! BTW for Backoffice you will not have friendly URLS, nor the language shortcuts /en/, /es/, etc are inlcuded in the URL. Back-office works only with the following URL's: domain+index.php+(sub-section)+controllers and tokens. Link to comment Share on other sites More sharing options...
Emiel Posted November 22, 2022 Share Posted November 22, 2022 (edited) I stumbled upon this issue myself as well and found the solution for multilingual Prestashop in combination with the friendly URL setting. In your nginx config you can add the following rule to handle multilingual calls to the index.php. In this case "nl" and "en", if you need more languages you can add them separated by a pipe. location ~ (/nl|/en)/index\.php$ { try_files $uri $uri/ /index.php?$args; } Edited November 22, 2022 by Emiel (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