Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-09-28 09:20:13

Myusername
Member
Registered: 2019-12-12
Posts: 162

Some questions about links

I would like to ask some questions about the links here, which would be good if someone could clarify me. Maybe I’m thinking something wrong.

In the textpattern, it is possible to access the sections through two links: domain.com/articles or domain.com/articles/. Right? Anything after the last slash that is not a parameter returns an error page. From what I’ve researched, search engines see these two urls as different urls, and it is recommended to use a 301 redirect from one to the other.

Another thing I noticed is that if I choose to use another url pattern, like /only-title, it is no longer possible to use /articles and Textpattern itself will redirect /articles to /articles/.

This extends to the individual pages as well: Think of the user who is using only one url pattern, and later uses more than one. All of your articles previously accessed by default without a slash at the end, are now all redirected to a url with a slash at the end. With that thought that search engines view both urls as different pages, can’t that cause SEO problems? After all, all the “power” you had in one URL, you won’t have in the other.

So the question is this: wouldn’t it be better to assume the URL with a slash at the end? I believe that, especially for new users this can cause some confusion.

A second solution would be to use a rel="canonical", but as far as I know, it would have to be a job done by the user anyway using some various textpattern tags, since there is no specific txp tag to generate a canonical url for each page.

Is this really a problem or am I talking nonsense?

Edit: In fact, I made a mistake about the individual pages. Apparently, it is only redirected to the url with a slash at the end when the url pattern id/title is used. Right? The individual pages make sense now. Sorry

Last edited by Myusername (2020-09-28 10:26:48)

Offline

#2 2020-09-28 11:58:44

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: Some questions about links

Myusername wrote #326141:

So the question is this: wouldn’t it be better to assume the URL with a slash at the end?

Why? According to the best practices, / should append indexes only: sections, categories, etc., including the front page. Which should contain links with descriprions, abstracts or excerpts only, avoiding fully duplicated contents from articles.

Offline

#3 2020-09-28 12:08:45

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: Some questions about links

I use <link rel="canonical" href="<txp:permlink />"> for articles, and <link rel="canonical" href="<txp:site_url /><txp:section />/"> (as txp:yield) for sections.

Offline

#4 2020-09-28 12:26:13

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 307
Website GitHub GitLab Twitter

Re: Some questions about links

Where needed, I have set HTTP 301 directives, e. g.

Match ^/section$ Redirect /section/

to append the slash, or

Match ^/category(/|)$ Redirect /

to deprecate an empty category name. In another website, where some sections are hand-crafted manually, I have made

Match ^/some-section/$ Redirect /some-section

to the landing article named ‛some-section’.

(The syntax here is for Hiawatha webserver, you should replace it for Apache, or to use txp:header, or Textpattern plugin for that).

Offline

#5 2020-09-28 12:31:49

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

Re: Some questions about links

In theory, unless you set a hidden pref, all txp-generated list links end with /, but not individual articles ones. If only one URL mode is in use, txp will try to recognize both end-slashed and not slashed links (for bw compatibility sake), since some users construct them manually. But with multiple URL modes txp has no mean to tell /some article from /some section, so old manually crafted links could break.

For canonical URLs try <txp:page_url context />.

Offline

Board footer

Powered by FluxBB