nginx opencart重写删除index.php?route

时间:2017-02-03 16:29:21

标签: php nginx url-rewriting opencart

我的网站使用以下链接打开主页:

https://www.azertranss.az/index.php?route=common/home

但我想删除 index.php?route = 如何使URL与此链接一起使用?

https://www.azertranss.az/common/home

我试过了:

rewrite ^/(.*)$ /index.php?_route_=$1 last;

实际配置如下:

# START  Rewrite rules

rewrite ^/sitemap.xml$ /index.php?route=feed/google_sitemap last;
rewrite ^/googlebase.xml$ /index.php?route=feed/google_base last;
rewrite ^/download/(.*) /index.php?route=error/not_found last;
if (!-f $request_filename) {
    set $rule_3 1$rule_3;
}
if (!-d $request_filename) {
    set $rule_3 2$rule_3;
}
if ($uri !~ ".*.(ico|gif|jpg|jpeg|png|js|css)") {
    set $rule_3 3$rule_3;
}
if ($rule_3 = "321") {
    rewrite ^/([^?]*) /index.php?_route_=$1 last;
}

# END  Rewrite rules

0 个答案:

没有答案