How to make a 301 redirect from a dynamic page with a parameter to it but without a parameter?

  • 0
    Tell me correctly 301 redirects from pages of this kind.
    / component / virtuemart / dinamicheskaya-chast? tmpl = component on it but without the tmpl parameter, the rest of the parameters must be left if they are.
    htaccess Anonymous, Aug 20, 2020

  • 1 Answers
  • 0
    Add
    to the beginning of .htaccess
    RewriteCond %{QUERY_STRING} ^(|.*?&)tmpl=component(?:$|&)(.*)
    RewriteRule .* /$0?%1%2 [R=301,L]
    Anonymous

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!