User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This is in addition to #5306 which was merged some time ago. While that pull request fixed issue with invalid article pages when article still had some pages, there was still a problem if you would completely remove page breaks from an article, because then the exception would never be thrown, it was too low in the code. Now if plugin detects that there are no pagebreaks in the article body, it will also additionaly check if there is a request for a subpage, and if yes throw 404.
To test, try opening some article that does not have page breaks and add to the end of the url ?start=xx where xx is any number. You should see the article normally. Apply the patch and make sure the same link gives 404 page.
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
That would be consistent with behaviour for an article with page breaks. Imagine you have article with pages 1 and 2 and then you decided to remove them, to display all content on single page. Without this change, requesting page 2 (or requesting any page number) would show article normally. Compare this with current behavior: imagine article has pages 1, 2 and 3, and you remove page 3. Then page 3 and all above would throw 404. I don't see why behaviour should be different whether there is 1 or more pages.
hello @chivitli
"consistent" but very SEO unfriendly
Some sites are overly aggressive and do not through 404 at all, NEVER,
and you suggest throughing a 404 for an article that it exists but had its multi-page content converted to single page ?
a 404 must be a very last choice
if you want to see this improved you can suggest a 303 redirect to the non paged URL
and if you would want to improve it further:
The current behavour was done based on the suggestion of @Hackwar at #5306 (comment) and @roland-d agreed at #5306 (comment)
Ok,
I fail to see that reducing the number of pages is good reason to throw a 404,
you have other choices to avoid "duplicate content" reasoning for throwing 404
What joomla should do if visitor go to third page in an article that in past had 5 pages but now the article has only 1.
Category | ⇒ | Front End Router / SEF |
It should not be responsability of pagebreak plugin to deal with canonicals, nor it can do this efficiently.
1) It cannot reliably determine which link is canonical, it can only use url though which it is accessed. Outputing that as "canonical" even though it may not be is probably not best for SEO.
2) Even if it could find correct canonical, they are automatically added in sef system plugin in the onAfterDispatch method. Page break plugin would have to parse all links already set in the document and unset canonical link if it exists. This again seems like mixing responabilities. Or it can try to change the canonical already set in the document, but this also seems like a strange functionality for page break plugin...
303 redirect to page 1 sounds ok to me, but I am not sure if it should be done here. Whatever option is chosen, behavour should be the same for articles that hasve page breaks, and invalid page is accessed, and for articles without page breaks, when invalid page is accessed. So either accepting this pull request and throwing always 404, or changing this and the change from #5306 to deal with it differently.
It should not be responsability of pagebreak plugin to deal with canonicals
agreed, i mentioned it as an option, i do not think that is correct to do it
303 redirect to page 1 sounds ok to me, but I am not sure if it should be done here. Whatever option is chosen, behavour should be the same for articles that hasve page breaks, and invalid page is accessed, and for articles without page breaks, when invalid page is accessed
yes i think make a 303 (or 302 ?) redirect instead of 404, for all of the invalid pages
it is the most proper and easy thing to do
Why is a redirect when you've tried paginating to a non-existing resource more correct than a 404? You've requested a resource that doesn't exist, by default that screams 404 to me. I'd say the fact that https://www.joomla.org/announcements/release-news.html?start=1500 renders a page saying "no articles" is the wrong behavior; different view but same concept, you've paginated beyond the number of available resources.
agree if @mbabker if a page doesn't exist is a 404
6.5.4. 404 Not Found
The 404 (Not Found) status code indicates that the origin server did
not find a current representation for the target resource or is not
willing to disclose that one exists. A 404 status code does not
indicate whether this lack of representation is temporary or
permanent; the 410 (Gone) status code is preferred over 404 if the
origin server knows, presumably through some configurable means, that
the condition is likely to be permanent.A 404 response is cacheable by default; i.e., unless otherwise
indicated by the method definition or explicit cache controls (see
Section 4.2.2 of [RFC7234]).
The article has not be deleted it may have less pages, or just 1,
For the sake of being "consistent" we tell visitors and search engines,
"get out of here" what you seek does not exist,
which is not true, an all-pages view of the article is not only right but it will most probably contain the desired content, you can even make 301 redirect with an expired cache time, in case someone in the future decides to re-add pages to it
anyway i don't care much about this
because it is rare that an article reduces the number of pages
Right, but it's the fact that a "sub-resource" of the article (for lack of better terms) no longer exists. The parent item (article) is there, but the resource (page whatever) has been removed for whatever reason. Since that resource no longer exists, that to me signifies that a 404 is the proper behavior, unless someone configures a redirect to handle that situation then what Joomla does by default doesn't really matter.
After all I think joomla may return error 404 with message which display correct link to article,
like "Page not found. Did you mean [correct link to article]?"
I have tested this item
I have tested this item
tested successfully
if ?showall=&start=4 will give a 404 on a multipage article with only 3 pages then it is correct that this pr will give a 404 with the same param on an article with only one page
Status | Pending | ⇒ | Ready to Commit |
Category | Front End Router / SEF | ⇒ | Front End Plugins Router / SEF |
RTC after two successful tests.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-22 18:07:53 |
Closed_By | ⇒ | rdeutz | |
Labels |
Added:
?
|
I am not sure I want to see a 404 in that circumstance
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11217.