【问题标题】:htaccess redirect 410 for URL that contains com_virtuemart包含 com_virtuemart 的 URL 的 htaccess 重定向 410
【发布时间】:2017-05-06 05:43:48
【问题描述】:

在.htaccess 中,我怎样才能对所有带有com_virtuemart 的URL 进行410 重定向。

任何类似:

index.php?page=shop.browse&option=com_virtuemart&search=GO&search_category=63&keyword1=43

【问题讨论】:

    标签: .htaccess joomla http-status-code-410


    【解决方案1】:

    com_virtuemart 是您网址中 QueryString 的一部分。您可以使用以下方法将具有 com_ 的 url 重定向到 410 错误状态。

    RewriteEngine on
    
    RewriteCond %{QUERY_STRING} com_virtuemart [NC]
    RewriteRule ^ - [R=410,L]
    

    【讨论】:

    • 您也可以使用“速记”G (gone) 标志代替R=410。 (410 走了)
    • 它不适用于:/index.php/component/com_virtuemart/itemid,6/category_id,56/flypage,flypage.tpl/page,shop.product_details/product_id,2253/ 我得到404
    • 您发布的 uri 不包含查询字符串。 Querystring 以 ? 问号开头。请参阅您的 OP 中的网址。
    • 无论如何,我的重定向插件中有很多这样的 URL,它们收集所有重定向,没有任何 ?在其中,它们在 Google 网站管理员工具中出现 404 错误:/index.php/component/com_virtuemart/Itemid,26/keyword1,45/page,shop.browse/search,GO/search_category,51/ 或 /index.php/component /com_virtuemart/Itemid,24/category_id,52/page,shop.browse/ 它应该是一个条件,com_virtuemart 作为 URL 的一部分,但不仅是 QUERY_STRING
    • 可能 RewriteEngine on RewriteCond %{QUERY_STRING} com_virtuemart [NC] RewriteRule ^ - [R=410,L] RewriteEngine on RewriteCond %{REQUEST_URI} com_virtuemart [NC] RewriteRule ^ - [R=410,L ]
    猜你喜欢
    • 2011-08-14
    • 2014-05-24
    • 2012-07-21
    • 2012-05-05
    • 2013-07-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-31
    相关资源
    最近更新 更多