1

In .htaccess how can I do a 410 redirection for all URLs with com_virtuemart.

Anything like:

index.php?page=shop.browse&option=com_virtuemart&search=GO&search_category=63&keyword1=43
MrWhite
  • 43,179
  • 8
  • 60
  • 84
Erick Boileau
  • 478
  • 4
  • 14

1 Answers1

2

com_virtuemart is part of QueryString in your url. You can use the following to redirect urls with com_ to 410 error status.

RewriteEngine on

RewriteCond %{QUERY_STRING} com_virtuemart [NC]
RewriteRule ^ - [R=410,L]
Amit Verma
  • 40,709
  • 21
  • 93
  • 115
  • You can also use the "shorthand" `G` (`gone`) flag instead of `R=410`. (410 Gone) – MrWhite May 06 '17 at 10:17
  • it does not work with : /index.php/component/com_virtuemart/itemid,6/category_id,56/flypage,flypage.tpl/page,shop.product_details/product_id,2253/ I am getting a 404 – Erick Boileau May 24 '17 at 09:10
  • The uri you posted does not include a query string. Querystring starts with a **?** question mark. See the url in your OP. – Amit Verma May 24 '17 at 11:40
  • anyway I get many URL like that in my redirect plugin that collect all redirections, without any ? in it they are under 404 errors in Google webmaster tools : /index.php/component/com_virtuemart/Itemid,26/keyword1,45/page,shop.browse/search,GO/search_category,51/ or /index.php/component/com_virtuemart/Itemid,24/category_id,52/page,shop.browse/ it should be a condition with com_virtuemart as a part of URL but not only as QUERY_STRING – Erick Boileau May 29 '17 at 08:56
  • maybe RewriteEngine on RewriteCond %{QUERY_STRING} com_virtuemart [NC] RewriteRule ^ - [R=410,L] RewriteEngine on RewriteCond %{REQUEST_URI} com_virtuemart [NC] RewriteRule ^ - [R=410,L] – Erick Boileau May 29 '17 at 09:03