Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
410 gone status for individual articles
For an entire section, this is easy to achieve, use the <txp:txp_die/>
tag in the section template.
For individual articles, this appears slightly more tricky.
- Using the
<txp:txp_die msg="" status="410 Gone" />
tag in the article (replacing the content of the article) sort of works (redirects to my 410 page, using the build in TXP template), but the article still shows up in article listings. - Simply deleting the article then returns a 404 error, which in this case is not correct. The resource is gone and not missing.
Ideas, suggestions ?
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: 410 gone status for individual articles
Use your first idea, but put your article on Persistant status, that wouldn’t work?
Offline
Re: 410 gone status for individual articles
You mean ‘sticky’ I guess ? (from the French ‘persistant’) :-)
Trying…
Nope. The article is not listed any more in listings, but trying to access the url directly doesn’t return the 410 page.
( I could off course use htaccess and create a static 410 page, but then I’d lose the benefits of my txp templates.)
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: 410 gone status for individual articles
phiw13 wrote:
You mean ‘sticky’ I guess ? (from the French ‘persistant’) :-)
Yup, sorry :/
Trying…
Nope. The article is not listed any more in listings, but trying to access the url directly doesn’t return the 410 page.
( I could off course use htaccess and create a static 410 page, but then I’d lose the benefits of my txp templates.)
Strange… I wander why live article can use the txp:die
but not sticky article.
Offline
Re: 410 gone status for individual articles
Ok, a sort of usable solution – or stop gap measure or something like that – for now.
- In the article body, use the
<txp:txp_die msg="" status="410 Gone" />
tag with an appropriate message. There is no need to delete the content of the article. Just insert the<txp:txp_die
before everything. That is what the outside world (people coming from an outside link, or a search engine, or even from a forgotten inside link, and the search engines will see. After hitting that 410 page, the search bots won’t index that one articles anymore. Yes Gone is gone, Virginia ! - Use excerpt for the article, and insert an appropriate message. This is what people will see if the article turns up in an article list (at least, that works in my case, those lists only display the excerpt).
That way, there is no big data loss (the article still exists in the data base, who knows if one wants to reuse parts of it), and the visitor gets a reasonably consistent message not to look for that particular content.
The weak point: if the body of the article still exist, it will turn up when the visitor uses the build search txp search function.
- -
Pondering about this issue, I seem to recall a previous discussion or feature request about having the possibility to set these (http) status messages in the write pane (under ‘Status’). Couldn’t find it back, though; but maybe the discussion was on the dev. mailing list.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline
Re: 410 gone status for individual articles
phiw13 wrote:
You mean ‘sticky’ I guess ? (from the French ‘persistant’) :-)
Trying…
Nope. The article is not listed any more in listings, but trying to access the url directly doesn’t return the 410 page.
That’s because your page templates are not set up to display individual sticky articles. I doubt it has anything to do with txp_die. If you set up your page templates, so that they show sticky articles when accessed via a permalink, the 410 page will work as well.
Offline
Re: 410 gone status for individual articles
Sencer wrote:
That’s because your page templates are not set up to display individual sticky articles. I doubt it has anything to do with txp_die. If you set up your page templates, so that they show sticky articles when accessed via a permalink, the 410 page will work as well.
Yup. That does it ! Individual article templates now take sticky articles and everything works fine. Cool. Now just a bit of conditional tagging in the 410 error template, and we have some powerful error system.
I knew I was missing something simple. It is TXP after all. Been out of it for too long… (and I need to reinvestigate the semantics of sticky articles).
Thanks Sencer.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
Offline