Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2020-07-03 16:28:30

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,313
Website

Re: Duplicate content

Ha ha! Friday afternoon. My internet is slow, I can’t view your videos yet, Yiannis, but this is making me laugh.

I tried the zem-redirect plugin but there are no instructions except for paying customers at threshold state, which no longer exists.

Perhaps we have crossed wires about Oleg’s code. I have been referring to

<txp:evaluate query='"<txp:site_url trim="/" /><txp:page_url type="req" />" != "<txp:page_url context />"'>
    <txp:txp_die status="404" />
</txp:evaluate>

I use that in my head (Edit: in the head of my page, not just in my own head which is also full of this stuff now!:-) along with Phil’s 4.8.1 TXP head code.

Regarding Oleg’s code when answering your slightly different question, Yiannis, ie

<txp:page_url context="id, s, c, context, q, m, month, author, commented" />

I’m not sure where that fits in with my problem. I think that’s for your scenario, Yiannis.

But it’s Friday afternoon so expect the unexpected.

Last edited by zero (2020-07-03 16:29:51)


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#32 2020-07-03 16:30:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,159
Website

Re: Duplicate content

zero wrote #324241:

Ha ha! Friday afternoon. My internet is slow, I can’t view your videos yet, Yiannis, but this is making me laugh.

I tried the zem-redirect plugin but there are no instructions except for paying customers at threshold state, which no longer exists.

Indeed but the instructions might not be needed as it works out of the box. Having said that, try Oleg’s recommendation first.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#33 2020-07-03 16:31:32

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,313
Website

Re: Duplicate content

colak wrote #324242:

Indeed but the instructions might not be needed as it works out of the box. Having said that, try Oleg’s recommendation first.

I don’t know why but I’m laughing my head off!

BTW, I’ve had no trouble with canonicals, they are all as expected or desired.

Last edited by zero (2020-07-03 16:38:39)


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#34 2020-07-03 16:46:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,159
Website

Re: Duplicate content

zero wrote #324241:

I’m not sure where that fits in with my problem. I think that’s for your scenario, Yiannis.

I think that my issue was sorted. You can try

<txp:evaluate query='"<txp:site_url trim="/" /><txp:page_url type="req" />" != "<txp:page_url context="id, s, c, context, q, m, month, author, commented" />"'>
    <txp:txp_die status="404" />
</txp:evaluate>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#35 2020-07-03 16:54:21

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,313
Website

Re: Duplicate content

colak wrote #324244:

I think that my issue was sorted. You can try

<txp:evaluate query='"<txp:site_url trim="/" /><txp:page_url type="req" />" != "<txp:page_url context="id, s, c, context, q, m, month, author, commented" />"'>...

Aah! Now I’m kind of getting it, but it will take me a lot of studying to understand how this works and the penny finally drops.

Anyway, comments are now working as expected, all seems to be well, must get something to eat, will report back again after more tests later.

THANK YOU BOTH!


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#36 2020-07-04 09:48:15

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,159
Website

Re: Duplicate content

etc wrote #324238:

Oh, I must have forgotten about comments, sorry. Also, not sure about anchors. Could you try to replace <txp:page_url context /> with

<txp:page_url context="id, s, c, context, q, m, month, author, commented" />...

and report back, please?

It works for my site but I also needed to add pg. Latest code

<txp:evaluate query='"<txp:site_url trim="/" /><txp:page_url type="req" />" != "<txp:page_url context="id, s, c, context, q, m, month, author, commented, pg" />"'>
    <txp:txp_die status="404" />
</txp:evaluate>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#37 2020-07-04 09:56:10

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,313
Website

Re: Duplicate content

It works well for me too, Oleg. I’m not totally certain feeds are updating as normal because I’m working on localhost, but I can subscribe to a feed with no problem, so I think it’s all good.


Wondrous Healing Wondrous ways to a healthy old age
Safe Reiki Harmless natural healing.
Gud One Blog

Offline

#38 2020-07-04 17:25:18

etc
Developer
Registered: 2010-11-11
Posts: 3,768
Website

Re: Duplicate content

colak wrote #324273:

It works for my site but I also needed to add pg.

Ah! Well, you get the idea: put in context any URL parameter that you consider valid for you site. Originally, context attribute was designed to create canonical links, not exactly for link validation. But, as ever, txp community is inventive beyond any limit :-)

Offline

#39 2020-07-04 17:33:28

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,159
Website

Re: Duplicate content

zero wrote #324274:

It works well for me too, Oleg. I’m not totally certain feeds are updating as normal because I’m working on localhost, but I can subscribe to a feed with no problem, so I think it’s all good.

Indeed I did not think of those. I’m wondering if we should add rss, atom to the list. I also checked com_connect which is behaving just fine.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#40 2020-07-04 17:38:55

etc
Developer
Registered: 2010-11-11
Posts: 3,768
Website

Re: Duplicate content

colak wrote #324284:

I’m wondering if we should add rss, atom to the list.

These are handled separately, I don’t think there is a problem, but you’d better check.

Offline

Board footer

Powered by FluxBB