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
最后设置好了,重启一下nginx
posted @ 2019-08-14 10:41  火鸟网络  阅读(1934)  评论(0编辑  收藏  举报