Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong http status code on feed #5849

Open
sshcli opened this issue Apr 10, 2018 · 18 comments
Open

Wrong http status code on feed #5849

sshcli opened this issue Apr 10, 2018 · 18 comments
Assignees
Milestone

Comments

@sshcli
Copy link
Member

sshcli commented Apr 10, 2018

Steps to reproduce the issue

  1. Try to access to the Welcome Mat Feed ( https://example.com/welcome-mat?format=feed )
    it should work ok, you should see the feed

  2. Now try to access to the Welcome Mat Feed with a typo in the URL
    ( https://example.com/welc-mat?format=feed )

Expected result

You should get HTTP status code: 404 Not Found
404

Actual result

You get HTTP status code: 500 Internal Server Error
500

System information (as much as possible)

Joomla version: 3.8.6
Kunena version: 5.1.0-RC6-DEV
Php version: 7.2.4
Database version: MySQL 5.6.38

Additional comments

@xillibit xillibit added this to the 5.1.0 milestone Apr 14, 2018
@xillibit
Copy link
Member

I have tried with your example and i obtain an 404 error

@sshcli
Copy link
Member Author

sshcli commented Apr 16, 2018

Please test it with these:

Good URL:
https://k51.jobsnear.net/sub-category?format=feed

Bad URL:
https://k51.jobsnear.net/subx-category?format=feed

Even if you see a 404 in the page title, the real http status code is 500

You can also test above URLs with this tool:
https://httpstatus.io/

@810
Copy link
Member

810 commented Apr 16, 2018

i have changed all 500 to 510, and i still see 500, so i think its from joomla core itself

@810 810 modified the milestones: 5.1.0, 5.1.1 May 14, 2018
@sshcli
Copy link
Member Author

sshcli commented May 30, 2018

Additional comments:

  1. The problem is for both, General RSS and Category RSS
  2. You start to see these errors in the google dashboard after modify the category alias to an existing category (Because those links are being indexed by google)

500

@sshcli
Copy link
Member Author

sshcli commented May 30, 2018

ohh, maybe to take into consideration for k.6 or above:
JSON Feed

@810 810 modified the milestones: 5.1.1, 5.1.2 Jun 22, 2018
@pgasiorowski
Copy link
Contributor

I think this ones comes from

Call to undefined method Joomla\CMS\Document\FeedDocument::addHeadLink()

which is a known issue since 3.8.2
joomla/joomla-cms#18966
joomla/joomla-cms#18962

@pgasiorowski
Copy link
Contributor

Other notes:

  • It might not a big issue when Kunena is setup for registered users only so Google won't be able to reach the feed URLs
  • This might already be fixed when custom template is in use. Otherwise no easy workaround may exist. One possible workaround
    • Create custom Joomla template from Protostar template
    • Edit /templates/[template]/error.php
    • Remove this block: <?php if (JModuleHelper::getModule('mod_search')) : ?>
    • Unless there is a way to create a template override for /templates/protostar/error.php (which I'm unaware of)

@sshcli
Copy link
Member Author

sshcli commented Jul 16, 2018

Remove this block:

That one solves this problem, I just tested.

What's next?
A. New PR in Joomla
B. New PR in Kunena
C. Forget about a general fix, keep the changes only for me and close this issue.

@xillibit xillibit modified the milestones: 5.1.2, 5.1.3 Jul 16, 2018
@xillibit
Copy link
Member

It seems to have no easy fix for that, so keep this for others users which have the same issue

@810 810 modified the milestones: 5.1.3, 5.1.4 Aug 31, 2018
@810 810 self-assigned this Sep 10, 2018
@Sulpher
Copy link

Sulpher commented Sep 18, 2018

I got the same issue after upgrading from 5.0 to Kunena 5.1.3.
Joomla 3.8.12
Kunena 5.1.3
PHP 7.0.32

@sshcli
Copy link
Member Author

sshcli commented Sep 18, 2018

In the meanwhile, what I'm doing is redirecting all those error pages to a custom 404 page.

Another thing I found is that these URLs are considered dynamic because of the structure
example.com/category?format=feed&type=rss

Dynamic URLs are not SEO friendly and we should avoid them when possible

@Sulpher
Copy link

Sulpher commented Oct 2, 2018

Is there any news concerning this issue? Is it possible to fix it?

@810 810 modified the milestones: 5.1.4, 5.1.6 Oct 14, 2018
@sshcli
Copy link
Member Author

sshcli commented Oct 27, 2018

what I'm doing is redirecting all those error pages to a custom 404 page.

Redirect 404 pages is not good for SEO

@sshcli
Copy link
Member Author

sshcli commented Oct 27, 2018

When Enable RSS Feeds = No
You will get 500 internal server errors instead of 404.

You can try it with this url format:
example.com/category?format=feed&type=rss

Please let me know if this a different bug not related to this one, to create a new issue for it

Waiting for your response.

@Sulpher
Copy link

Sulpher commented Oct 28, 2018

Finally, I discovered the issue I faced with was caused by 3rd party extension and I got 404 error instead of RSS. Now the problem is resolved. So, my request here was a mistake.
As for the issue described in this task, I just been tested with my server environment and could not reproduce 500 error when RSS is enabled or disabled. All works fine on my side.

@xillibit xillibit removed this from the 5.1.6 milestone Nov 25, 2018
@xillibit xillibit added this to the 5.1.8 milestone Nov 25, 2018
@pgasiorowski
Copy link
Contributor

I believe this issue has been addressed in recent 3.9.2

search

@sshcli
Copy link
Member Author

sshcli commented Jan 22, 2019

Yes, it has been fixed in J.3.9.2.
if Kunena does not need additional changes, we can close this issue.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity.

@810 810 modified the milestones: 5.1.8, 5.1.17 Apr 13, 2020
@810 810 modified the milestones: 5.1.17, 5.1.18 Jun 10, 2020
@xillibit xillibit modified the milestones: 5.1.18, 5.1.19 Jul 26, 2020
@xillibit xillibit added 5.2 and removed 5.1 labels Aug 14, 2020
@xillibit xillibit modified the milestones: 5.1.19, 5.2 Aug 14, 2020
@xillibit xillibit removed the 5.2 label Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants