apache - 301 redirection in opencart -
i using opencart 1.5.6 , moved store subdomain main domain. i'm trying redirect of old static category pages actual opencart category/product pages.
here .htaccess line:
redirect 301 /old-category.html http://www.mydomain.com/my-new-category this rule works fine of urls of them takes me to:
http://www.mydomain.com/my-new-category?route=old-category.html
some people suggested utilize rewriterule instead or add together question mark in end, did seek nil works !
i tried putting rules before , after next block:
rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewriterule ^download/(.*) /index.php?route=error/not_found [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewriterule ^([^?]*) index.php?_route_=$1 [l,qsa] anyone has thought ?
this should work:
rewriteengine on rewriterule ^old-category\.html$ http://www.mydomain.com/my-new-category [l,nc,r=301] rewriterule ^sitemap.xml$ index.php?route=feed/google_sitemap [l] rewriterule ^googlebase.xml$ index.php?route=feed/google_base [l] rewriterule ^download/(.*) /index.php?route=error/not_found [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{request_uri} !.*\.(ico|gif|jpg|jpeg|png|js|css) rewriterule ^(.+)$ index.php?_route_=$1 [l,qsa] make sure test in new browser avoid 301 caching issues.
apache .htaccess redirect opencart
No comments:
Post a Comment