Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Offline
Re: deactivate something...
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: deactivate something...
franzl wrote #334564:
So there is no way to disable rss and atom. Thanks for the hint.
A dirty hack: In Admin > Preferences > Feeds, set “How many articles should be included in feeds?“ to zero (0). If some person tries to access the feed, the feed will contain nothing. Some feed readers might complain with a “no articles in feed” type of message.
You could also use htaccess to issue a “permanently gone” or “404” status for /rss
and /atom
.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: deactivate something...
phiw13 wrote #334572:
A dirty hack: In Admin > Preferences > Feeds, set “How many articles should be included in feeds?“ to zero (0). If some person tries to access the feed, the feed will contain nothing. Some feed readers might complain with a “no articles in feed” type of message.
This could actually be another candidate for totally disabling (also link
area) feeds. I don’t see a point of outputting an empty feed.
Offline
Re: deactivate something...
etc wrote #334575:
This could actually be another candidate for totally disabling (also
link
area) feeds. I don’t see a point of outputting an empty feed.
Yes. Above I was looking at ways – in 4.8.8 – to neutralise feeds.
BTW, in your current implementation on dev
, this: domain.tld/rss/
returns 404 not found
while domain.tld/rss
returns a feed with 0 articles. Is that a side effect of the fact the tag (<txp:feed_link />
) outputs domain.tld/rss/
? The same goes for /atom
of course
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: deactivate something...
phiw13 wrote #334576:
BTW, in your current implementation on
dev
, this:domain.tld/rss/
returns404 not found
whiledomain.tld/rss
returns a feed with 0 articles.
Interesting. Both return a 404
for me and I don’t see how it could be different. Once you land on atom.php/rss.php
(via whatever URL), the processing is the same.
Offline
Re: deactivate something...
The output of the <txp:feed_link>
tag should honour the in-force trailing slash pref. The 404 should then respond accordingly. I can’t see why it wouldn’t after a cursory glance. Hmmm.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: deactivate something...
Yes the output of <txp:feed_link>
outputs /rss/
or /atom/
(and results in a 404, expected in the case at hand). I was playing with /rss
(no trailing slash) putting myself in the shoes of someone – the evil spy! – who really wants to try to access the feed, even if the site does not provide any reference.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: deactivate something...
With or without the trailing slash, if there is no in_rss
section, I get 404. At least, after the last commit.
Offline
Re: deactivate something...
OK, some further testing:
First on https://dev-demo.textpattern.co/dev/
. After toggling the settings ( both the messy url to section/title
and the Presentation > Section toggle), I indeed get a 404 for /atom/
(and /rss/
,and variant).
On localhost, a brand new install, all default settings except the two settings above. In this case, I do get an atom-flavoured xml file as a response [*], which has no articles in it. That is the same as the other installs I used for previous tests. I have no idea what is different. Localhost runs on Apache and PHP 8.2.1.
[*] Safari wants to open in a feed reader (expected for that kind of file), Firefox downloads it and Brave (Chromium/Blink) displays the raw XML.
For the record, here is the whole transaction, seen by CURL:
curl -L -I http://txpdev.local/atom/
HTTP/1.1 200 OK
Date: Fri, 27 Jan 2023 01:51:29 GMT
Server: Apache/2.4.55 (Unix) PHP/8.2.1
X-Powered-By: PHP/8.2.1
Content-Type: application/atom+xml; charset=utf-8
and contents of the file:
curl http://txpdev.local/atom/
<?xml version="1.0" encoding="UTF-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
<title type="text">My site</title>
<subtitle type="text">My site slogan</subtitle>
<link rel="self" href="http://txpdev.local/atom/" />
<link rel="alternate" type="text/html" href="http://txpdev.local/" />
<id>tag:txpdev.local,2005:b416d642f46ee0959b1887636a6f6064</id>
<generator uri="https://textpattern.com/" version="4.9.0-dev">Textpattern</generator>
<updated>2023-01-27T01:50:49+00:00</updated>
<author>
<name>phiw13</name>
<uri>http://txpdev.local/</uri>
</author>
</feed>
<!-- Trace summary:
Runtime : 7.38 ms
Query time: 4.00 ms
Queries : 6
Memory (*): 559 kB
-->
For brevity, I clipped the debug info
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: deactivate something...
phiw13 wrote #334586:
First on
https://dev-demo.textpattern.co/dev/
. After toggling the settings ( both the messy url tosection/title
and the Presentation > Section toggle), I indeed get a 404 for/atom/
(and/rss/
,and variant).
Unfortunately, clean modes do not work on the demo site, so the 404 you see is sent by nginx, not txp. You’d get it for /articles/
too.
On localhost, a brand new install, all default settings except the two settings above.
You have, however, set in_rss
to No
for all sections, right? Then it’s weird and not reproducible on my side.
Offline
Re: deactivate something...
etc wrote #334587:
You have, however, set
in_rss
toNo
for all sections, right? Then it’s weird and not reproducible on my side.
Yes, for each and every section (1! default install).
I’ll need to have a look at the demo server again…
BTW, would this be more appropriate when feeds are disabled: HTTP 501 of 405 (MDN)?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline