Kunena / Kunena-Forum

Kunena Forum - Forum / Bulletin Board / Discussions component for Joomla - This is the 6.x/5.x main development branch. Please do not open issues regarding earlier versions of Kunena
https://www.kunena.org
GNU General Public License v3.0
1.75k stars 811 forks source link

Wrong http status code on feed #5849

Open sshcli opened 6 years ago

sshcli commented 6 years ago

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 commented 6 years ago

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

sshcli commented 6 years ago

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 commented 6 years ago

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

sshcli commented 6 years ago

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 commented 6 years ago

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

pgasiorowski commented 6 years ago

I think this ones comes from

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

which is a known issue since 3.8.2 https://github.com/joomla/joomla-cms/pull/18966 https://github.com/joomla/joomla-cms/issues/18962

pgasiorowski commented 6 years ago

Other notes:

sshcli commented 6 years ago

Remove this block: <?php if (JModuleHelper::getModule('mod_search')) : ?>

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 commented 6 years ago

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

Sulpher commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

sshcli commented 5 years ago

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

Redirect 404 pages is not good for SEO

sshcli commented 5 years ago

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 commented 5 years ago

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.

pgasiorowski commented 5 years ago

I believe this issue has been addressed in recent 3.9.2

search

sshcli commented 5 years ago

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

github-actions[bot] commented 4 years ago

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