Jump to content

Prestashop 1.4 Ngnix configuration


Recommended Posts

Appending ngnix rewrite rules for prestashop 1.4

Comments welcome.

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/c/$1$2.jpg last;
rewrite "^/([0-9]+)\-[a-zA-Z0-9-]*\.html" /product.php?id_product=$1 last;
rewrite "^/([0-9]+)\-[a-zA-Z0-9-]*" /category.php?id_category=$1 last;
rewrite "^/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html" /product.php?id_product=$1 last;
rewrite "^/([0-9]+)__([a-zA-Z0-9-]*)" /supplier.php?id_supplier=$1 last;
rewrite "^/([0-9]+)_([a-zA-Z0-9-]*)" /manufacturer.php?id_manufacturer=$1 last;
rewrite "^/content/([0-9]+)\-([a-zA-Z0-9-]*)" /cms.php?isolang=$1&id;_cms=$2 last;
rewrite "^/content/category/([0-9]+)\-([a-zA-Z0-9-]*)" /cms.php?isolang=$1&id;_cms_category=$2 last;
rewrite "^/([a-z]{2})/[a-zA-Z0-9-]*/([0-9]+)\-[a-zA-Z0-9-]*\.html" /product.php?id_product=$2&isolang;=$1 last;
rewrite "^/([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*\.html" /product.php?id_product=$2&isolang;=$1 last;
rewrite "^/([a-z]{2})/([0-9]+)\-[a-zA-Z0-9-]*" /category.php?id_category=$2&isolang;=$1 last;
rewrite "^/([a-z]{2})/content/([0-9]+)\-[a-zA-Z0-9-]*" /cms.php?isolang=$1&id;_cms=$2 last;
rewrite "^/([a-z]{2})/content/category/([0-9]+)\-[a-zA-Z0-9-]*" /cms.php?isolang=$1&id;_cms_category=$2 last;
rewrite "^/([a-z]{2})/([0-9]+)__[a-zA-Z0-9-]*" /supplier.php?isolang=$1&id;_supplier=$2 last;
rewrite "^/([a-z]{2})/([0-9]+)_[a-zA-Z0-9-]*" /manufacturer.php?isolang=$1&id;_manufacturer=$2 last;
rewrite "^/lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html" /product.php?id_product=$3&isolang;=$1 last;
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html" /product.php?id_product=$2&isolang;=$1 last;
rewrite "^/lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)" /category.php?id_category=$2&isolang;=$1 last;
rewrite "^/en/address$" /address.php?isolang=en last;
rewrite "^/en/addresses$" /addresses.php?isolang=en last;
rewrite "^/en/authentication$" /authentication.php?isolang=en last;
rewrite "^/en/cart$" /cart.php?isolang=en last;
rewrite "^/en/discount$" /discount.php?isolang=en last;
rewrite "^/en/guest-tracking$" /guest-tracking.php?isolang=en last;
rewrite "^/en/order-history$" /history.php?isolang=en last;
rewrite "^/en/identity$" /identity.php?isolang=en last;
rewrite "^/en/my-account$" /my-account.php?isolang=en last;
rewrite "^/en/order$" /order.php?isolang=en last;
rewrite "^/en/order-follow$" /order-follow.php?isolang=en last;
rewrite "^/en/quick-order$" /order-opc.php?isolang=en last;
rewrite "^/en/order-slip$" /order-slip.php?isolang=en last;
rewrite "^/en/search$" /search.php?isolang=en last;
rewrite "^/en/stores$" /stores.php?isolang=en last;
rewrite "^/en/([^?&]*)" /$1?isolang=en last;

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...