opencart nginx静态化设置

在niginx设置里添加下面代码,(lnmp的可能是 网址.conf文件添加)

  # SEO URL Settings
  # Nginx configuration of OC htaccess
  location = /sitemap.xml {
    rewrite ^(.*)$ /index.php?route=feed/google_sitemap break; 
  } 

  location = /googlebase.xml {
    rewrite ^(.*)$ /index.php?route=feed/google_base break; 
  } 

  location / {
    # This try_files directive is used to enable SEO-friendly URLs for OpenCart
    try_files $uri $uri/ @opencart;
  }

  location @opencart {
    rewrite ^/(.+)$ /index.php?_route_=$1 last;
  }
  # End SEO settings
最后设置好了,重启一下ng
posted @ 2020-05-13 15:04  xiaobingch  阅读(617)  评论(0)    收藏  举报