Jump to content

Edit History

Hightmar

Hightmar

Hello,

I just installed PS and I have a problem with NGINX and URL rewriting. I followed a lot of tutoring but nothing to do.
This part of the code keeps redirecting me to the index all the time.

try_files $uri $uri/ /index.php?$args;

So there's nothing I can do. Has anyone who has ever had the problem ever solved it?
Thank you.

 

With this code it's almost ok. The URL are right rewritten

 # Prestashop

        rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last;

        rewrite ^/([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2$3.jpg last;

        rewrite ^/([0-9]+)\-([0-9]+)/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1-$2.jpg last;

        rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$1$2.jpg last;

        rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$1$2$3.jpg last;

        rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last;

        rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last;

        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last;

        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last;

        rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$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])([0-9])(\-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9.jpg last;

        rewrite ^/c/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg last;

        rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+\.jpg$ /img/c/$1.jpg last;

        rewrite ^/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 last;

        rewrite ^/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1$3 last;

        rewrite ^/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 last;

        rewrite ^/([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 last;

        rewrite ^/([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 last;

        rewrite ^/content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1$3 last;

        rewrite ^/content/category/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms_category=$1$3 last;

        rewrite ^/([0-9]+)(\-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*\.jpg$ /img/c/$1$2.jpg last;

        rewrite ^/page-non-trouvee(.*)$ /404.php$1 last;

        rewrite ^/adresse(.*)$ /address.php$1 last;

        rewrite ^/adresses(.*)$ /addresses.php$1 last;

        rewrite ^/authentification(.*)$ /authentication.php$1 last;

        rewrite ^/meilleures-ventes(.*)$ /best-sales.php$1 last;

        rewrite ^/panier(.*)$ /cart.php$1 last;

        rewrite ^/contactez-nous(.*)$ /contact-form.php$1 last;

        rewrite ^/bons-de-reduction(.*)$ /discount.php$1 last;

        rewrite ^/suivi-commande-invite(.*)$ /guest-tracking.php$1 last;

        rewrite ^/historique-des-commandes(.*)$ /history.php$1 last;

        rewrite ^/identite(.*)$ /identity.php$1 last;

        rewrite ^/marques(.*)$ /manufacturer.php$1 last;

        rewrite ^/mon-compte(.*)$ /my-account.php$1 last;

        rewrite ^/nouveaux-produits(.*)$ /new-products.php$1 last;

        rewrite ^/commande(.*)$ /order.php$1 last;

        rewrite ^/details-de-la-commande(.*)$ /order-follow.php$1 last;

        rewrite ^/commande-rapide(.*)$ /order-opc.php$1 last;

        rewrite ^/avoirs(.*)$ /order-slip.php$1 last;

        rewrite ^/mot-de-passe-oublie(.*)$ /password.php$1 last;

        rewrite ^/promotions(.*)$ /prices-drop.php$1 last;

        rewrite ^/recherche(.*)$ /search.php$1 last;

        rewrite ^/plan-du-site(.*)$ /sitemap.php$1 last;

        rewrite ^/magasins(.*)$ /stores.php$1 last;

        rewrite ^/fournisseurs(.*)$ /supplier.php$1 last;

But I got instead of my product

File not found. 

 

Hightmar

Hightmar

Hello,

I just installed PS and I have a problem with NGINX and URL rewriting. I followed a lot of tutoring but nothing to do.
This part of the code keeps redirecting me to the index all the time.

try_files $uri $uri/ /index.php?$args;

try_files $uri $uri/ /index.php?$args;

So there's nothing I can do. Has anyone who has ever had the problem ever solved it?
Thank you.

×
×
  • Create New...