在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