Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 Today 09:30:06

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,177
Website GitHub

404 when article_url matches a section name in "Title only". Bug?

You can reproduce this on the test demo (currently showing until next demo refresh on the hour):

Section = testing
Section is set to \Title url scheme
Article “testing” is assigned to the testing section.
Article “one-two-three” is assigned to the testing section.

Results:

\testing\testing   --> is found
\testing\2\testing --> is found
\testing\          --> shows landing page
\testing           --> 404 (but this is what I want)
\one-two-three     --> is found

I can work around it, of course, by changing either the section or article title. Is this a known anomaly?


TXP Builders – finely-crafted code, design and txp

Offline

#2 Today 10:05:13

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

Re: 404 when article_url matches a section name in "Title only". Bug?

Does the result change in your favour if you alter the Preference for trailing slashes?


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 Today 14:12:44

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,177
Website GitHub

Re: 404 when article_url matches a section name in "Title only". Bug?

Thanks! Didn’t think of that.

But unfortunately that doesn’t help. While setting to “no” allows you to reach the URL, you get the landing page, not the article. Here’s an overview:

With trailing slashes set to no:

/testing/testing   --> page is found
/testing/testing/  --> 404 - not found
/testing           --> shows landing page
/testing/          --> 404 - not found

With trailing slashes set to yes:

/testing/testing   --> 404 - not found
/testing/testing/  --> is found
/testing           --> 404 - not found
/testing/          --> shows landing page

With trailing slashes set to list:

/testing/testing   --> page is found
/testing/testing/  --> page is found
/testing           --> 404 - not found (this should be the individual article, I think)
/one-two-three     --> page is found (individual article)
/testing/          --> shows landing page

TXP Builders – finely-crafted code, design and txp

Offline

#4 Today 14:45:09

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

Re: 404 when article_url matches a section name in "Title only". Bug?

That’s not exactly a bug, rather a processing simplification. If an article and a section have identical names, txp prepends its id to the article URL, even in title_only mode. Otherwise, in yes/no slash modes, there would be no mean to disambiguate. Tweaking it for list mode has some cost, namely because many url schemes can be used in parallel.

Offline

Board footer

Powered by FluxBB