Discussion:
404 on Prestashop 1.5 under nginx
tonimarmol
2013-05-28 10:52:47 UTC
Permalink
I have a problem with nginx giving a 404 error on a Prestashop 1.5.4.1
site.

This is the URL returning the 404:
www.domain.com/es/index.php?controller=order-confirmation

The prestashop is under multilanguage enviroment. Then I have:

www.domain.com/en/
www.domain.com/es/
www.domain.com/fr/
www.domain.com/de/
The URL rewriting runs fine, except when the url have the "index.php". Then
nginx returns de 404.

I think the problem is on nginx virtualhost configuration, but I don't know
what it's failing.

My nginx configuration: http://pastebin.com/CFQ5hwNX

That nginx configuration runs perfect on a Prestashop with only 1 domain
(without the /lang/ on the url).

Nginx version: 1.4.0

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,239630#msg-239630
tonimarmol
2013-05-28 13:13:37 UTC
Permalink
The problem is solved.

The issue was on Prestashop.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,239633#msg-239633
DivisionX
2013-08-10 23:09:26 UTC
Permalink
Hello! I have the same problem with prestashop 1.5.4.1, please tell how did
you resolve it.
Waiting for reply. Thanks!

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,241757#msg-241757
tonimarmol
2013-10-08 13:39:32 UTC
Permalink
The problem is on prestashop configuration. Not nginx.

You must define (add if not exists) the custom name of the url on the "SEO &
URL" tab.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,243523#msg-243523
Dougadan
2014-03-27 11:12:34 UTC
Permalink
Hi tonimarmol, can you elaborate. I'm having this issue on fresh install of
1.6. Under SEO & URL the Order Confirmation is going to a default Prestashop
page, order-confirmation. Apparently there is already a default page where
customers should be redirected after purchase. Where would I change?
Thanks much
Daniel

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,248751#msg-248751
tonimarmol
2014-03-27 11:22:19 UTC
Permalink
You must go to "SEO & URLS" under "Preferences" tab, and add all
pages/sections/modules that don't have a friendly url. (Press the add
button, and it will show you the pages without a friendly url)

Maybe you need to add the SEO URL of a payment module.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,248757#msg-248757
Dougadan
2014-03-27 11:57:29 UTC
Permalink
Thanks. Yes, under SEO & URLS, the Order Confirmation has a friendly URL,
and PayPal module does not have any page for Order confirmation without a
friendly URL. Under SEO & URL, Order Confirmation is going to a default
Prestashop page, order-confirmation.

After payment is completed in PayPal, when clicking the link to return to
the site, I get to the site, but a 404 page not available for the order
confirmation. Here is what the link shows:
[mysite]/order-confirmation.php?id_cart=20&id_module=73&key=[key]

Shopping cart ID is correct for the purchase. Under SEO & URL, Order
Confirmation is going to a default Prestashop page, order-confirmation.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,248765#msg-248765
tonimarmol
2014-03-27 12:15:36 UTC
Permalink
That paypal module I think it not compatible with Prestashop 1.6 because
it's using order-confirmation.php file and this file is deleted on PS 1.6.

I think the module will be updated soon...

Anyways, have a look on Prestashop 1.5 and create the same file:
order-confirmation.php


<?php

require(dirname(__FILE__).'/config/config.inc.php');

Tools::redirect('index.php?controller=order-confirmation'.((count($_GET) ||
count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') :
''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');




Good luck

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,248768#msg-248768
Dougadan
2014-03-27 14:08:15 UTC
Permalink
Thanks very much. I have been working on this all morning. After your
message, there was a load of updates in 1.6, more than 65 modules, including
PayPal. I was hoping, but it didn't fix the error.

You were directly on target, becuase it called up the
order-confirmation.php. So I uploaded these from my PS 1.5, all the order...
php files in the root. Now, when returning to my site via the link in PayPal
site, it now goes to my site with a list of the customer's orders.

It's a work around, but done for now. Thanks

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,248780#msg-248780
lmwood
2013-10-08 11:09:03 UTC
Permalink
What was the solution to this problem? I am also searching for the answer to
this.

Thanks in advance.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,243508#msg-243508
tonimarmol
2013-10-08 13:39:18 UTC
Permalink
The problem is on prestashop configuration. Not nginx.

You must define (add if not exists) the custom name of the url on the "SEO &
URL" tab.

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,239630,243522#msg-243522
David B.
2014-08-12 10:13:52 UTC
Permalink
Hi,

Here is the right solution. you should not set all redirection in nginx
configuration server section as some proposed. you'll have to modify the
file each time you want to add a url redirection.

To make it nice :

You shoud 1st modify the pool of php-fpm,

env[HTTP_MOD_REWRITE] = "on"

This is the variable expected by Prestashop to test if rewrite is
enabled

Next in nginx server section add :

location / {
try_files $uri $uri/ /index.php?q=$request_uri;
}

Now when an url is passing, it will try 1st to resolv, if not exist,
then will try as forder, if not it will pass it to the main controler,
if an url rewrited exist it will call the right controller.

Regards

David
--
Posted via http://www.ruby-forum.com/.
Loading...