0

Im trying to remove list of url marked as duplicate in search console, those url are already 404 but it creates double 301 redirect before ended up as 404

https://www.domaincom/2017/11/post.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+library+(library+-+library+info,+student)&m=1

Creating 301 redirect to

https://www.domaincom/2017/11/post.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A%20library%20%28library%20-%20library%20info%2C%20student%29&m=1

And creating another 301 redirect before ended up as 404, i did create 410 rules for each individual url but its seems doesnt work

  Redirect 410 /2017/11/post.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+library+(library+-+library+info,+student)&m=1
  Redirect 410 /2017/11/post.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A%20library%20%28library%20-%20library%20info%2C%20student%29&m=1

But both url still having 301 status before final status 404 not 410 ( maybe because url get encoded?), Im trying to set 410 every url having ending parameter

?utm_source=feedburner&utm_medium

Can Someone help me with correct htacces code?

====edit====

this one works incase someone need it

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteBase /
 RewriteCond %{QUERY_STRING} utm_source=feedburner
 RewriteRule .* - [G,L]
 RewriteRule ^index\.php$ - [L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
</IfModule>
  • The `Redirect` directive matches path prefixes, you can not use it to match the query string part of a URL; for that you will need to use mod_rewrite, a `RewriteCond` can perform checks on that using the respective variable. – 04FS Feb 03 '20 at 08:06
  • hi 04FS can you be more specific about that? – adi sucipto Feb 03 '20 at 11:17
  • https://stackoverflow.com/questions/2252238/how-can-i-match-query-string-variables-with-mod-rewrite – 04FS Feb 03 '20 at 11:31

0 Answers0