Forum: NGINX 404 on Prestashop 1.5 under nginx

2974d09ac2541e892966b762aad84943?d=identicon&s=25 tonimarmol (Guest)
on 2013-05-28 12:53
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tonimarmol (Guest)
on 2013-05-28 15:14
(Received via mailing list)
The problem is solved.

The issue was on Prestashop.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,239630,239633#msg-239633
2974d09ac2541e892966b762aad84943?d=identicon&s=25 DivisionX (Guest)
on 2013-08-11 01:09
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 lmwood (Guest)
on 2013-10-08 13:09
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tonimarmol (Guest)
on 2013-10-08 15:40
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tonimarmol (Guest)
on 2013-10-08 15:40
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Dougadan (Guest)
on 2014-03-27 12:13
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tonimarmol (Guest)
on 2014-03-27 12:22
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Dougadan (Guest)
on 2014-03-27 12:57
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 tonimarmol (Guest)
on 2014-03-27 13:16
(Received via mailing list)
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
2974d09ac2541e892966b762aad84943?d=identicon&s=25 Dougadan (Guest)
on 2014-03-27 15:08
(Received via mailing list)
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
Ea77f759af0102053a257b9396493551?d=identicon&s=25 David B. (david_b58)
on 2014-08-12 12:13
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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.