.htaccess - redirect urls from query string -
i'm trying redirect urls query string using code:
rewritecond %{the_request} ^[a-z]+\ /([^?#\ ]*)\?[^\ ]*\ http/ rewriterule (.+) http://www.example.com/$1? [r=301,l]
this worked for: www.example.com/mypage.html?gclid=xxx
but not work for:
www.example.com/?gclid=xxx www.example.com/mypage.html/?gclid=xxx
also tried unsuccessfully [1]:this answer [question]:redirecting in htaccess query string url
rewritecond %{the_request} ^[a-z]{3,9}\ /\?gclid=([a-z]+)&type=([a-z\-]+) [nc] rewriterule ^ /%1/%2? [l,r=301] rewritecond %{the_request} ^[a-z]{3,9}\ /\?gclid=([a-z]+)($|\ ) [nc] rewriterule (.+) http://www.example.com/$1? [r=301,l]
what changes do?
thank much
Comments
Post a Comment