Toni Mármol Posted May 28, 2013 Share Posted May 28, 2013 (edited) 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 the 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 Edited May 28, 2013 by anmaral79 (see edit history) Link to comment Share on other sites More sharing options...
Toni Mármol Posted May 28, 2013 Author Share Posted May 28, 2013 I had a problem with the file Tools.php overrided with a wrong version. Link to comment Share on other sites More sharing options...
Nelson Posted July 18, 2013 Share Posted July 18, 2013 Hi "anmaral79" I have the same problem, how you are resoved this problem exactely ? Thank's for your replay Best Regards Link to comment Share on other sites More sharing options...
Toni Mármol Posted October 1, 2013 Author Share Posted October 1, 2013 Sorry for the late answer... I think the real problem is that not exists the SEO-URL for the page that gives the 404 error. Solution? You must go to SEO-URL on Preferences and add the url that not exists. 2 Link to comment Share on other sites More sharing options...
Kerm Posted December 1, 2013 Share Posted December 1, 2013 I have same problem on my prestashop 1.5.5.0 and i dont understand about what u talk, i have rewrite rules for 404 page > page-not-found Link to comment Share on other sites More sharing options...
kernity Posted February 12, 2014 Share Posted February 12, 2014 Hi, You can add this rules in nginx rewrite rules just before the "try_files $uri $uri/ /index.php$is_args$args;" lines. It can help if you enable multilanguage prestashop mode and it fixes a lot other buggy links like : /en/index.php?controller=order-confirmation /en/index.php?controller=pdf-invoice The line to add in your nginx configuration : rewrite ^/[a-zA-Z][a-zA-Z]/index.php(.*)$ /index.php$1; Cheers, 1 Link to comment Share on other sites More sharing options...
baloghge Posted December 5, 2014 Share Posted December 5, 2014 Thanks so much for this piece of code. This solved many minor problems i had with the shop! Thanks a mill! Greg Link to comment Share on other sites More sharing options...
kynoconcepts Posted January 31, 2015 Share Posted January 31, 2015 (edited) Never mind.... thx Edited January 31, 2015 by kynoconcepts (see edit history) Link to comment Share on other sites More sharing options...
a_smith Posted February 20, 2015 Share Posted February 20, 2015 Hi, You can add this rules in nginx rewrite rules just before the "try_files $uri $uri/ /index.php$is_args$args;" lines. It can help if you enable multilanguage prestashop mode and it fixes a lot other buggy links like : /en/index.php?controller=order-confirmation /en/index.php?controller=pdf-invoice The line to add in your nginx configuration : rewrite ^/[a-zA-Z][a-zA-Z]/index.php(.*)$ /index.php$1; Cheers, Hi kernity Can you help more with this problem please? I try to get my 3 stores working on nginx for a second day now... you wrote: just before the "try_files $uri $uri/ /index.php$is_args$args;" lines.... my nginx config does not have this where should I put your code? rewrite ^/[a-zA-Z][a-zA-Z]/index.php(.*)$ /index.php$1; I have tried PS TEAM solution here: http://doc.prestashop.com/display/PS16/System+Administrator+Guide#SystemAdministratorGuide-NginxfriendlyURLs but its rubbish it doesnt work either. thanks Link to comment Share on other sites More sharing options...
kernity Posted February 20, 2015 Share Posted February 20, 2015 (edited) Hi, Here you can more about my nginx configuration for the shop. You can see where to put the line. ..... rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last; rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last; rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last; rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last; rewrite ^/[a-zA-Z][a-zA-Z]/index.php(.*)$ /index.php$1; try_files $uri $uri/ /index.php$is_args$args; error_page 404 /index.php?controller=404; ....... Edited February 20, 2015 by kernity (see edit history) Link to comment Share on other sites More sharing options...
sjaakie3 Posted May 11, 2015 Share Posted May 11, 2015 It can help if you enable multilanguage prestashop mode and it fixes a lot other buggy links like : /en/index.php?controller=order-confirmation /en/index.php?controller=pdf-invoice I got it all working using the seo%urls page, Take a look at some examples on the page, it is not too hard to do yourself. CC Link to comment Share on other sites More sharing options...
maxetc Posted January 12, 2017 Share Posted January 12, 2017 You must go to SEO-URL on Preferences and add the url that not exists. I did this. It's work. Link to comment Share on other sites More sharing options...
Nelson Posted January 12, 2017 Share Posted January 12, 2017 Sorry but where you add this URL ??? with /en /de /it .... Link to comment Share on other sites More sharing options...
Recommended Posts