Announcement

#1 2016-03-11 04:34:06

windracer
Member
St. Pete, FL
2014-12-28
458

Disable RSS feeds

Is there an easy way to disable the RSS feed? I've got those menu items hidden but just now realized that you can still browse directly to notification.php and feed.php and get the feeds. How can I turn those off (other than just renaming or protecting those two PHP files)?

Operating system: Linux
PHP: 5.6.11-1ubuntu3.1 (Show info) [2016-03-10 22:32:17]
MySQL: 5.6.28-0ubuntu0.15.10.1 [2016-03-10 22:32:17]
Graphics Library: External ImageMagick 6.8.9-9

Offline

 

#2 2016-03-14 11:55:32

IngoT
Guest

Re: Disable RSS feeds

Edit

/include/menubar.inc.php

editing in this file, the line 287 and the following

Or seeking: // notification

// notification
    //$block->data['rss'] =
      //array(
       //'TITLE'=>l10n('RSS feed'),
        //'NAME'=>l10n('Notification'),
        //'URL'=> get_root_url().'notification.php',
        //'REL'=> 'rel="nofollow"'
      //);

Do before a backup of the file , which is required before changes


Greeting, Ingo.

 

#3 2016-03-14 14:55:41

windracer
Member
St. Pete, FL
2014-12-28
458

Re: Disable RSS feeds

That doesn't disable the feeds. All that would do is remove the menu item, which I've already done via Advanced Menu Manager. I'm trying to prevent people from navigating directly to notification.php or feed.php, not just hide the option.

Offline

 

#4 2016-03-14 20:12:01

Zentalquabula
Member
2014-05-10
217

Re: Disable RSS feeds

.htaccess or apache configuration file:

SetEnvIfNoCase Request_Uri "/feed.php" feed
Deny from env=feed

Last edited by Zentalquabula (2016-03-15 00:23:07)

Offline

 

#5 2016-03-15 00:16:02

windracer
Member
St. Pete, FL
2014-12-28
458

Re: Disable RSS feeds

Ah, good idea Zentalquabula ... thanks for the idea.

I ended up putting this in my piwigo.conf file for Apache:

Code:

SetEnvIf Request_Uri "/photos/feed.php" feed
SetEnvIf Request_Uri "/photos/notification.php" notification
Deny from env=feed
Deny from env=notification

And now you can't access those two pages directly:

Code:

[Mon Mar 14 19:12:42.779846 2016] [access_compat:error] [pid 18100] [client xxx] AH01797: client denied by server configuration: /usr/local/piwigo/feed.php
[Mon Mar 14 19:12:43.021914 2016] [access_compat:error] [pid 18100] [client xxx] AH01797: client denied by server configuration: /usr/local/piwigo/notification.php

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact