Search code examples
apache.htaccessmagento-1.9

Block rss in Magento


I need to block this URL: https://example.com/rss/catalog/notifystock/ on my site.

I wrote following code to block:

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

but its block the following URL: https://example.com/index.php/rss/catalog/notifystock/

It has not blocked this URL: https://example.com/rss/catalog/notifystock/

Can anyone Please help


Solution

  • Try and use this rule instead:

    RewriteRule rss - [F]
    

    What that should do is block access to any page that has rss in its URL. You could also use:

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

    So if a file matches rss, then it will deny access to everyone. However, if you're using Apache 2.4, then it would be:

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