Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2023-01-25 08:34:15

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

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

#17 2023-01-25 08:49:40

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,666
Website

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
phiw13 on Codeberg

Offline

#18 2023-01-25 09:06:53

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: deactivate something...

phiw13 wrote #334576:

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.

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

#19 2023-01-25 09:12:43

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 12,485
Website GitHub

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.

Hire Txp Builders – finely-crafted code, design and Txp

Offline

#20 2023-01-25 10:05:59

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,666
Website

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
phiw13 on Codeberg

Offline

#21 2023-01-25 11:02:41

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

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

#22 2023-01-27 03:16:09

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,666
Website

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
phiw13 on Codeberg

Offline

#23 2023-01-27 10:24:58

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: deactivate something...

phiw13 wrote #334586:

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).

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

#24 2023-01-27 11:42:05

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,666
Website

Re: deactivate something...

etc wrote #334587:

You have, however, set in_rss to No 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
phiw13 on Codeberg

Offline

#25 2023-01-30 12:02:29

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 34

Re: deactivate something...

phiw13 wrote #334589:

BTW, would this be more appropriate when feeds are disabled: HTTP 501 of 405 (MDN)?

It would be more flexible, if it just gives an 404 errorcode.
If you change your opinion to activate rss/atom than just activate it and use it.
5xx errorcodes are server errors. Thats not a good way for SEO.

Offline

#26 2023-01-31 07:55:44

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,666
Website

Re: deactivate something...

Uh? Nothing stands in the way of changing your mind if you use those error codes. And I think those are actually more SEO friendly. A 404 is never good, as far as I understand it. Missing… that could mean “we can’t be bothered to fix this” – especially if you leave it in that (missing) state for a longer period.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#27 2023-01-31 13:43:10

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 34

Re: deactivate something...

Sorry, but that is not true. An 404 errorcode give the searchengins a sign that this site is not active and not visitable.

An 5xx error is an server error. That show the search engine: maybe come back later, when we have fixed it.
Thats a wrong sign. Dont forget your crawl-volumen. Give the right sign and give searcengines bots a guide.

Last edited by franzl (2023-01-31 13:44:49)

Offline

#28 2023-02-01 00:02:22

phiw13
Plugin Author
From: South-Western Japan
Registered: 2004-02-27
Posts: 3,666
Website

Re: deactivate something...

from MDN, 404 Not Found

The HTTP 404 Not Found response status code indicates that the server cannot find the requested resource. Links that lead to a 404 page are often called broken or dead links and can be subject to link rot.

I don’t see anything in that saying “not active”. And I have seen enough times the Google Search Console complaining that this or that page is 404 missing


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg

Offline

#29 2023-02-01 11:50:48

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 34

Re: deactivate something...

If a site is gone, you can give an 403 errorcode. That´s a different.

If you deactivate a site you have to delete all links to that site. That should be clear. If you still have links zu a missing site, don´t wonder about it. Its up to you to delete all links to a deactivated site.

I do SEO for almost 20 years. If you think that you have to give search engines an another errorcode i.e a 5xx, so do it. It´s your decision on your own website. cheers :)

Last edited by franzl (2023-02-01 11:52:22)

Offline

#30 2023-02-01 13:28:26

etc
Developer
Registered: 2010-11-11
Posts: 5,683
Website GitHub

Re: deactivate something...

I don’t know what is the right status to return here, but, to avoid creating dead links, in txp 4.9 <txp:if_section /> tag adopts filter attribute:

<txp:if_section filter="in_rss">
    <txp:feed_link />
<txp:else />
    RSS feed is not available. 
</txp:if_section>

Offline

Board footer

Powered by FluxBB