I am creating some 301 redirects in one of my sites, to eliminate indexed URLs and leave it a little more optimized.
Well, if I redirect between tags for example:
redirect 301 /videos/coche-electrico.html https://www.dominio.com/videos/coches-electricos.html
It works well, that is, it redirects correctly. The problem I have is when I try to do a similar redirect, but instead of redirecting between tags like the previous case, I try to do it from label to category. That is:
redirect 301 /videos/coche-electrico.html https://www.dominio.com/categoria/coches-electricos/
Making me redirect like this:
https://www.dominio .com/categoria/coches-electricos/?tag=coche-electrico
Part of the .htaccess code is this:
Rewriterule ^videos/(.)_(.).html$ index.php?tag=$1&page=$2 [L,NC]
Rewriterule ^videos/(.*).html$ index.php?tag=$1 [L,NC]
I have also tried to isolate the problem and only do so:
RewriteRule ^clientes/(\w+)/?$ clientes.php?id=$1 [L]
Redirect 301 /clientes/juan http://google.es
And the redirection that he makes in this case in google, also drags the id=juan
:
https://www.google.es/?id=juan&gws_rd=ssl
Does anyone know how I can do the redirect without passing any parameter or value, leaving the redirection clean?
https://www.dominio.com/categoria/coches-electricos/