How to make the correct redirect .htaccess?


On the website there was a need to do a 301 redirect.
In the site root is .htaccess with the following content:
<filesmatch "\.md5$">
 Deny from all
DirectoryIndex index.php
# Comment the following line, if the option Multiviews not allowed here
AddDefaultCharset utf-8
<ifmodule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{REQUEST_URI} !\.(js|css|jpg|jpeg|gif|png)$
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule ^(.*)$ index.php [L,QSA]
<ifmodule mod_headers.c>
 <filesmatch "\.(jpg|jpeg|png|gif|js|css)$">
 Header set Cache-Control "max-age=3153600, public"
Redirect 301 /category/zhenskaya-parfumeria/

When you click on the link:
what you need, but if the url has UTM codes of the form:
the server provides a 404 error.
With this label, starting with
work correctly.
Tell me how to do correctly redirect to work &utm codes? Will replace in htaccess symbol "&" with "?" and how to make it?
September 26th 19 at 11:28
2 answers
September 26th 19 at 11:30
I'm not good at .htaccess, try

Redirect 301 /category/zhenskaya-parfumeria(.*)$1
September 26th 19 at 11:32
You can do this:
RewriteEngine On
Options +FollowSymLinks
RewriteRule ^category/zhenskaya-parfumeria$ /zhenskaya-parfumeria$1 [QSA,NC,R=301,L]

Here is a good article which describes the flags and commands for all redirects.

Find more questions by tags htaccess