Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-07-01 10:07:18

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

Duplicate content

I just discovered that example.com, example.com/, example.com/category/, example.com/author/, example.com/2020/ all have the same content. I can 301 redirect those. There may be others like that?

But I also found that example.com?=a, example.com?=b, example.com?=c etc and even example.com?=sdlkfjl and anything after the ?= also give the same content as example.com. I tried it on textpattern.com and on neme.org and it’s just the same. There’s no 404 not found.

Is there some way of redirecting ?=* for everything except ?=q so the expected result of 404 not found appears?


Dozy P My attempt at music

Offline

#2 2020-07-01 10:55:32

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

Re: Duplicate content

Odd it happens on textpattern.com. I wonder if the rewrite rules are not working properly? On a test server of my own (though I am admittedly running 4.8.2-dev), a link to example.org/category does indeed return a 404, while example.org/category/some-cat returns the categorised content as expected. And /YYYY/mm/dd links should definitely return those article lists!

On .com I don’t know if we’ve set up /author links to function or not. But example.org/ and example.org should resolve to the same endpoint automatically.

?=something isn’t a valid thing we look for so that’s expected. ?q=something resolves fine for searches in my tests.

Paging @petecooper who might be able to shed some light on this. Is it a core 4.8.1 bug or a server misconfiguration? Intriguingly, both 4.8.1 and 4.8.2-dev demo sites exhibit the same behaviour.

Last edited by Bloke (2020-07-01 10:59:01)


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

#3 2020-07-01 11:17:19

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

Re: Duplicate content

I’m trying to ensure there CANNOT be duplicate content on my site. The examples I gave show a massive amount of potential for duplicate content. For example, G might view example.org/category/ or example.org/2020/ as sections and easily find them.

I remember years ago getting warnings from the G web dev console thingy about ?=something but at the time I didn’t consider it important for some reason or another. Perhaps it is though.


Dozy P My attempt at music

Offline

#4 2020-07-01 15:10:20

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,795
GitHub

Re: Duplicate content

zero wrote #324140:

But I also found that example.com?=a, example.com?=b, example.com?=c etc and even example.com?=sdlkfjl and anything after the ?= also give the same content as example.com. I tried it on textpattern.com and on neme.org and it’s just the same. There’s no 404 not found.

You won’t see a 404 because the page is rendering correctly. The ?=a, ?=b or whatever you tack on is a query string – but in the context you’re using (i.e ‘question mark equals something’), there is no parameter to set.

For a valid query string with a parameter, you need something like ‘question mark parameter equals something’. In the case of Textpattern sections, this works: example.com?s=lemon.

If the URL has a query string but the parameters are either a) not set or b) have nothing to do with Textpattern (e.g utm stuff on analytics), the page will render as usual. So unless I’m misunderstanding it, no harm, no foul.

I’m trying to ensure there CANNOT be duplicate content on my site. The examples I gave show a massive amount of potential for duplicate content.

Canonical URLs are your friend, friend: moz.com/learn/seo/canonicalization

Edit: words.

Last edited by gaekwad (2020-07-01 15:11:55)

Offline

#5 2020-07-01 15:23:36

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

Re: Duplicate content

Yes I know about canonicals and that txp uses them well, but I want to have no duplicate content at all, hidden or not. I’m useless with .htaccess and all that deep coding stuff so that’s why I’ve asked if there’s a way to redirect the ?=* to a blank page or something, in such a way that the search is not interfered with.


Dozy P My attempt at music

Offline

#6 2020-07-01 20:55:10

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

Re: Duplicate content

You can try the following, at your own risk :-)

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

Offline

#7 2020-07-01 21:06:35

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

Re: Duplicate content

The workarounds and canonicals and hacks are fine but it doesn’t get away from the question: why do the invalid URLs:

example.org/category/
example.org/author/

not 404? Why do they return the home page content? Is that down to the page template setup? The server? And why on my sites do they both 404 (as expected) yet on .com and the demo site (and neme.org, it seems) they just return… well, the front page?

Makes me nervous something’s not right in core.


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

#8 2020-07-01 21:31:33

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

Re: Duplicate content

Bloke wrote #324172:

And why on my sites do they both 404 (as expected) yet on .com and the demo site (and neme.org, it seems) they just return… well, the front page?

Makes me nervous something’s not right in core.

Unless your public language is not English, it does not comply with core which will (rather logically) handle example.org/category/ in the same way as example.org/?c=.

Offline

#9 2020-07-02 05:24:04

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

Re: Duplicate content

etc wrote #324171:

You can try the following, at your own risk :-)

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

Fantastic. 503 Service Unavailable. You just saved me hours maybe days of searching. It’s a shame that you guys use Paypal to receive donations, (with its recaptcha)

Thanks Oleg.

BTW, your site also has duplicate /category/, /author/ content.

Last edited by zero (2020-07-02 05:25:39)


Dozy P My attempt at music

Offline

#10 2020-07-02 05:26:59

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,395
Website GitHub Mastodon Twitter

Re: Duplicate content

etc wrote #324171:

You can try the following, at your own risk :-)

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

Where should this be added? Also, is there a way to return a 404 rather than a 503?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#11 2020-07-02 05:28:32

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

Re: Duplicate content

colak wrote #324180:

Where should this be added? Also, is there a way to return a 404 rather than a 503?

I put in the head of the default page


Dozy P My attempt at music

Offline

#12 2020-07-02 10:32:39

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

Re: Duplicate content

zero wrote #324179:

It’s a shame that you guys use Paypal to receive donations, (with its recaptcha)

Shame on you to worry about SEO :-)

BTW, your site also has duplicate /category/, /author/ content.

My site uses some extra URL parameters in code examples, so forbidding non-canonical links would not work. And then I don’t care.

colak wrote #324180:

Where should this be added? Also, is there a way to return a 404 rather than a 503?

Try <txp:txp_die status="404" />?

Offline

#13 2020-07-02 13:16:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,395
Website GitHub Mastodon Twitter

Re: Duplicate content

etc wrote #324189:

Try <txp:txp_die status="404" />?

As you said, try “at your own risk.” It unfortunately does not work as expected desired on deeper url schemas (section/categories/article) and returns a 404 when landing on /section/cat1/cat2/ pages.

Last edited by colak (2020-07-02 13:18:11)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#14 2020-07-02 13:21:27

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,795
GitHub

Re: Duplicate content

I will admit to being a bit baffled by this – no antagonistic intentions, just trying to understand.

If you want search engines to have non-duplicate content, totally understandable – that’s what canonical is for. I’m a bit fuzzy where the 503 / 404 errors are useful – does this mean anyone with a link to a page on your site that’s considered duplicate content get an error instead of the page content, or is intended as a search engine housekeeping exercise so any dupes will get rinsed out on the next run?

Last edited by gaekwad (2020-07-02 13:22:56)

Offline

#15 2020-07-02 14:40:47

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,395
Website GitHub Mastodon Twitter

Re: Duplicate content

gaekwad wrote #324199:

I will admit to being a bit baffled by this – no antagonistic intentions, just trying to understand.

If you want search engines to have non-duplicate content, totally understandable – that’s what canonical is for. I’m a bit fuzzy where the 503 / 404 errors are useful – does this mean anyone with a link to a page on your site that’s considered duplicate content get an error instead of the page content, or is intended as a search engine housekeeping exercise so any dupes will get rinsed out on the next run?

Hi Pete,

there is an issue with the way txp understands the desired canonical url.

For example when using

<link rel="canonical" href="<txp:site_url trim="/" /><txp:page_url />" />

in the head of the document, it will parse the tags whatever the url is which renders it semantically wrong. So, what would the recommendation be in order to have the desired url in there? Also, the breadcrumbs tag, returns urls that are again not the desired ones.

I agree with many people in this community regarding the issues plaguing the search engines but at the same time, we all desire traffic from beyond those we have sent an email or gave our card to. As such we are engaged in a Hegelian master–slave dialectic that we cannot escape from. ie. There is no master unless recognised by the slaves.

In my view, maybe because I vividly remember and believe in the 90s web, search engines are the most appropriate places to have our work discovered. The idea should not be to destroy Google but to apply pressure in order to get it fixed.

As such, and having personally accepted that my relationship with Google and other search engines is a relationship of connivance, I am trying, like many others, to play ball and serve our content in a way which would increase our visibility (not our SEO).


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB