【问题标题】:Block rss in Magento在 Magento 中阻止 RSS
【发布时间】:2017-07-20 13:42:07
【问题描述】:

我需要在我的网站上屏蔽此 URL:https://example.com/rss/catalog/notifystock/

我写了以下代码来阻止:

RewriteRule ^(index.php/?)?rss/ - [L,R=403]

但它阻止了以下 URL:https://example.com/index.php/rss/catalog/notifystock/

它没有屏蔽这个网址:https://example.com/rss/catalog/notifystock/

谁能帮忙

【问题讨论】:

    标签: apache .htaccess magento-1.9


    【解决方案1】:

    尝试使用此规则:

    RewriteRule rss - [F]
    

    应该做的是阻止对其 URL 中包含 rss 的任何页面的访问。你也可以使用:

    <FilesMatch "rss$">
        order allow,deny
        deny from all
    </FilesMatch>
    

    所以如果一个文件与 rss 匹配,那么它将拒绝所有人的访问。但是,如果您使用的是 Apache 2.4,那么它将是:

    <FilesMatch "rss$">
        Require all denied
    </FilesMatch>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-06-22
      • 2011-08-13
      • 2012-02-27
      • 1970-01-01
      • 2013-12-25
      相关资源
      最近更新 更多