opencart2.2.0.0从LAMP到LNMP转移

opencart2.2.0.0从LAMP到LNMP转移

需要修改根目录和admin目录的config.php文件,然后nginx的伪静态设置成如下。

# 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