Browse Source

Update prestashop.stpl

Change if by try_files
Arturo Blanco 5 years ago
parent
commit
98e09a15e1
1 changed files with 2 additions and 4 deletions
  1. 2 4
      install/deb/templates/web/nginx/php-fpm/prestashop.stpl

+ 2 - 4
install/deb/templates/web/nginx/php-fpm/prestashop.stpl

@@ -105,10 +105,7 @@ server {
     }
     }
 
 
     location / {
     location / {
-        if (!-e $request_filename)
-        {
-            rewrite ^(.+)$ /index.php?q=$1 last;
-        }
+        try_files $uri $uri/ /index.php?$args;
 
 
         location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
         location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
             expires 30d;
             expires 30d;
@@ -116,6 +113,7 @@ server {
         }
         }
 
 
         location ~ [^/]\.php(/|$) {
         location ~ [^/]\.php(/|$) {
+	    try_files $fastcgi_script_name /index.php$uri&$args =404;
 	    fastcgi_split_path_info ^(.+\.php)(/.+)$;
 	    fastcgi_split_path_info ^(.+\.php)(/.+)$;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
             fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
             if (!-f $document_root$fastcgi_script_name) {
             if (!-f $document_root$fastcgi_script_name) {