Jump to content

Problem with module and multi-languages


JuanMans

Recommended Posts

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 by JuanMans
formatting (see edit history)
Link to comment
Share on other sites

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 by JuanMans
more details (see edit history)
Link to comment
Share on other sites

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

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 by JuanMans
format (see edit history)
Link to comment
Share on other sites

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. 

Screenshot 2020-01-15 at 15.48.23.png

Screenshot 2020-01-15 at 15.43.29.png

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

  • 2 years later...

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 by Emiel (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...