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

转载于:https://www.cnblogs.com/firebirdweb/p/11350440.html

你可能感兴趣的:(opencart nginx静态化设置)