saosangmo
saosangmo

Reputation: 13

Redirect with htaccess always append ?_route_

I add the code:

RedirectMatch 301 /san-pham/khuyen-mai/ /khuyen-mai

In default .htaccess file in opencart but the result will return:

http://myphamthiennhien.com/khuyen-mai?_route_=san-pham/khuyen-mai

You can test it here http://myphamthiennhien.com/san-pham/khuyen-mai/

How can I solve it?

Upvotes: 1

Views: 58

Answers (1)

anubhava
anubhava

Reputation: 785611

Use mod_rewrite to strip off query-string:

RewriteEngine On

RewriteRule ^san-pham/khuyen-mai/ /khuyen-mai? [L,R=301,NC]

Note ? in the end, that is required to strip query string.

Upvotes: 1

Related Questions