Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2019-09-08 10:30:36

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 33

Add a trailing slash

Hey!

Is there any way to add a trailing slash?

· blog/
· blog/article/

Offline

#2 2019-09-08 15:52:45

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: Add a trailing slash

If you simply manually place a slash after your txp:permlink tag, e.g <txp:permlink />/ or <txp:section />/ Textpattern will create those links in the respective html code. If I recall correctly Textpattern should respond correctly to those as long out of the box. You can easily try it out on your site by simply placing an extra slash in the browser’s url bar and seeing if you get the desired result.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2019-09-13 15:41:43

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 33

Re: Add a trailing slash

Unfortunately thats not the solution.
It possible to add a slash by editing the HTACCES file. So it will automatically add a trailing slash.
If I do so, even when I manually add a trailing slash in the browsers adress bar I´m getting a 404 error.
Any other suggestions?

Offline

#4 2019-09-14 05:20:58

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

Re: Add a trailing slash

OK, I cannot pretend that I know what I am recommending here but try changing

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]

to

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/]) - [PT,L]

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

Offline

#5 2019-09-14 08:10:59

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 33

Re: Add a trailing slash

Thanks colak. I know how to change the htaccess to get an trailing slash at the end of the url.
That is not the problem. I want Textpattern to open and render an artikel with that slash. Textpattern is not able to deliver an url with an trailing slash.

Offline

#6 2019-09-14 09:41:29

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

Re: Add a trailing slash

franzl wrote #319298:

Textpattern is not able to deliver an url with an trailing slash.

It is, in section/title permlink mode, but I suppose you use just title? How would txp know whether /animals/ is a section or an article? Two db queries? What if you need both?

Offline

#7 2019-09-15 15:24:03

franzl
Member
From: germany
Registered: 2019-08-11
Posts: 33

Re: Add a trailing slash

Ah okay. Now all comes together.
Thanks to jakob, colak and etc.

@etc: Thats it. That was my fault to have the wrong permlink.

Offline

Board footer

Powered by FluxBB