Skip to content

Serve correct 404 status for URLs with invalid controller name#45646

Merged
rdeutz merged 2 commits intojoomla:5.3-devfrom
Denitz:patch-21
Aug 1, 2025
Merged

Serve correct 404 status for URLs with invalid controller name#45646
rdeutz merged 2 commits intojoomla:5.3-devfrom
Denitz:patch-21

Conversation

@Denitz
Copy link
Copy Markdown
Contributor

@Denitz Denitz commented Jun 23, 2025

Summary of Changes

Currently, if a page is loaded with task handling invalid controller, Joomla reports 500 server error status.

But logically, it should be a 404 response, but not a server error.

For instance, I have a custom notifier on server errors, but it's just an invalid URL, or it could be an old URL with menu item type changes. Once indexed by search engine, it will send you 500 errors.

Testing Instructions

Load any usual single article URL with appended invalid task like ?task=foo.bar, i.e.:

https://www.joomla.org/announcements/release-news/5928-joomla-5-3-1-bugfix-release.html?task=foo.bar

Actual result BEFORE applying this Pull Request

Invalid URL returns 500 status.

image

Expected result AFTER applying this Pull Request

Invalid URL returns 404 status.

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

@muhme
Copy link
Copy Markdown
Contributor

muhme commented Jul 25, 2025

I have tested this item ✅ successfully on 963fbd1


Tested with JBT, before applying this PR:

After applying the PR:

  • 404 Not Found
  • Also 404 Not Found for combined parameter first?catid=2&task=foo.bar
  • Other URL parameters still work: first?catid=2

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45646.

@hans2103
Copy link
Copy Markdown
Contributor

hans2103 commented Jul 25, 2025

I have tested this item ✅ successfully on 963fbd1


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45646.

Before

Screenshot 2025-07-25 at 20 23 23

After

Screenshot 2025-07-25 at 20 23 51

@richard67
Copy link
Copy Markdown
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45646.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jul 25, 2025
@exlemor
Copy link
Copy Markdown

exlemor commented Jul 25, 2025

I have tested this item ✅ successfully on 963fbd1

I have tested this successfully... thanks @Denitz!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45646.

@rdeutz rdeutz merged commit bb70fe2 into joomla:5.3-dev Aug 1, 2025
39 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Aug 1, 2025
@QuyTon QuyTon added this to the Joomla! 5.3.3 milestone Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants