Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2022-12-02 12:04:28

Sten
New Member
Registered: 2022-11-03
Posts: 4

How do I add a slash at the end of URLs

Hi,
I am searching how to add a terminal slash after the urls, specifically in the posts list. Could you tell me how can I do this?
Thank you

Offline

#2 2022-12-02 17:12:40

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

Re: How do I add a slash at the end of URLs

Sten wrote #334229:

Hi,
I am searching how to add a terminal slash after the urls, specifically in the posts list. Could you tell me how can I do this?
Thank you

It would be semantically wrong as it would imply that each article resides in its own folder. Furthermore, depending on what url schema you currently use, it may result into conflicts.


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

Offline

#3 2022-12-02 18:12:20

Sten
New Member
Registered: 2022-11-03
Posts: 4

Re: How do I add a slash at the end of URLs

colak wrote #334231:

It would be semantically wrong as it would imply that each article resides in its own folder. Furthermore, depending on what url schema you currently use, it may result into conflicts.

Thank you Yiannis, yes you are right but there is no extension of a file (php,…) and so when I want to post on Facebook, it does not get the image.

Last edited by Sten (2022-12-02 18:12:40)

Offline

#4 2022-12-02 22:37:19

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,270
Website GitHub

Re: How do I add a slash at the end of URLs

Sten wrote #334232:

Thank you Yiannis, yes you are right but there is no extension of a file (php,…) and so when I want to post on Facebook, it does not get the image.

Please could you supply a link of something you’re trying to post? I’m curious why Facebook enforces a trailing slash on links and refuses to load image content without it.

In general, we try to stick to the following conventions:

  • Anything with a ‘list’ context gets a trailing slash, which indicates there’s more under here.
  • Any individual single content (article, image, etc) gets no trailing slash to denote it’s a final endpoint.

The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#5 2022-12-23 21:44:18

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

Re: How do I add a slash at the end of URLs

The upcoming txp version has now a preference to add (remove) a slash to (from) all txp URLs. Please test who can with various mixes of permlink modes (note that the demo site will not work since it does not support clean modes).

Offline

Board footer

Powered by FluxBB