PR-6.2-dev Pending

User tests: Successful: Unsuccessful:

avatar bembelimen
bembelimen
9 Aug 2026

Pull Request resolves # .

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

When currently calling an menu item type URL, with index.php?Itemid=xxx you get a 404. This has the downsite, that when an URL is used on many places you have to add it directly and when it changes, you have to change them everywhere. With this PR you just update the menu item and it updates everywhere, where the correct index.php?Itemid=xxx is used.

Testing Instructions

  • Create a menu item type "URL" and put in any URL like "https://www.joomla.org"
  • Remember the ID of the menu item.
  • Create an article and insert the menu item as link via the "CMS Content" dropdown (should look like index.php?Itemid=102)

Actual result BEFORE applying this Pull Request

  • 404 error when clicking the link

Expected result AFTER applying this Pull Request

  • Clean (301) redirect to the URL given
avatar bembelimen bembelimen - open - 9 Aug 2026
avatar bembelimen bembelimen - change - 9 Aug 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Aug 2026
Category ⇒ Administration com_menus Language & Strings Libraries
avatar bembelimen bembelimen - change - 10 Aug 2026
Labels Added: Language Change PR-6.2-dev
avatar joomla-cms-bot joomla-cms-bot - change - 10 Aug 2026
Category Administration com_menus Language & Strings Libraries ⇒ Libraries
avatar chmst
chmst - comment - 10 Aug 2026

I have tested this successfully.
In my opinion it is a bug fix and should go into 5.4. It is a bug when a link item causes a 404.

I added such menu item into different articles and the fix works for all.

avatar chmst chmst - test_item - 10 Aug 2026 - Tested successfully
avatar chmst
chmst - comment - 10 Aug 2026

I have tested this item ✅ successfully on 5574c6f

The labels are not valid now. Changes are only in libraries.


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

avatar chmst
chmst - comment - 10 Aug 2026

I have tested this item ✅ successfully on 5574c6f

The labels are not valid now. Changes are only in libraries.


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

avatar brianteeman
brianteeman - comment - 10 Aug 2026

Can you update the title please

avatar bembelimen bembelimen - change - 10 Aug 2026
Title
…
[6.2] Add URL redirection option for menu items type URL
[6.2] Redirect external URL when called index.php?Itemid=xxx
avatar bembelimen bembelimen - edited - 10 Aug 2026
avatar bembelimen bembelimen - change - 10 Aug 2026
The description was changed
avatar bembelimen bembelimen - edited - 10 Aug 2026
avatar brianteeman brianteeman - test_item - 10 Aug 2026 - Tested successfully
avatar brianteeman
brianteeman - comment - 10 Aug 2026

I have tested this item ✅ successfully on 5574c6f


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

avatar brianteeman
brianteeman - comment - 10 Aug 2026

I have tested this item ✅ successfully on 5574c6f


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

avatar Fedik
Fedik - comment - 11 Aug 2026

I would not do this.

When currently calling an menu item type URL, with index.php?Itemid=xxx you get a 404. T

This should be fixed in backend while rendering, there a method called Route::_();
Call of Route::_(index.php?Itemid=xxx); with correct ID will produce correct URl

Also suggested implementation is "risky" and could produce unexpected bugs.

avatar LadySolveig
LadySolveig - comment - 13 Aug 2026

Agree with Fedik. Looks more like a band aid than a real fix.

avatar richard67
richard67 - comment - 18 Aug 2026

@bembelimen How do we continue here? Have you checked @Fedik 's and @LadySolveig 's previous comments?

avatar bembelimen
bembelimen - comment - 22 Aug 2026

I just add it at the same place where "alias-redirects" are handled. Using Route::_(....) renders perhaps the correct URL (the external one I guess) but it still throws an error when opening index.php?Itemid=xxx in the browser.

avatar LadySolveig
LadySolveig - comment - 22 Aug 2026

Alias here is a little bit different, as there is, after all, an explicit option in the menu item to set the redirect, and this is disabled by default. If I’m not getting this wrong, it’s only used in this way here, when it is set explicitly by the user).

avatar Fedik
Fedik - comment - 22 Aug 2026

Yeah, the alias menu is really different. It is not a "real menu".
It should not be used directly like index.php?Itemid=alias_ID in navigation,
When, for example, you turn off SEF you will get index.php?Itemid=ID where ID is the ID of the linked menu, not id of the alias menu.

avatar bembelimen
bembelimen - comment - 23 Aug 2026

You're saying, throwing a 404 should still be the solution when calling the URL menu via Itemid. Does not sound correct for me when we just can fix it to redirect to the correct URL.

avatar Fedik
Fedik - comment - 23 Aug 2026

You're saying, throwing a 404 should still be the solution when calling the URL menu via Itemid

Correct, for not a real menu types. The Alias menu item is not a real menu it is an alias :)
And as @LadySolveig already wrote, User have to enable redirect for this menu type when it is needed. Otherwise it should be 404

avatar Fedik
Fedik - comment - 23 Aug 2026

You're saying, throwing a 404 should still be the solution when calling the URL menu via Itemid

Correct, for not a real menu types. The Alias menu item is not a real menu it is an alias :)
(It was made just for "visuals", to be able to show the same menu item in diferent modules, without creating a new menu item)

And as @LadySolveig already wrote, User have to enable redirect for this menu type when it is needed. Otherwise it should be 404

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

Why not at least make it consistent and add an opt-in for a redirect here, just as we have in the alias, if you really want to?

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

As you seem to be spending a lot of time at the moment working on optimising the UX in conjunction with TinyMCE, I can certainly see where the idea comes from.
I can’t say I’m entirely convinced that a menu item, of all things, is the right choice for something like this, but I can at least see where the idea comes from.

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

Or, if you prefer, you could integrate it into the redirect component as an additional option that can be used across the entire site.

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

As you seem to be spending a lot of time at the moment working on optimising the UX iin terms of using TinyMCE, I can certainly see where the idea comes from.
I can’t say I’m entirely convinced that a menu item, of all things, is the right choice for something like this, but I can at least see where the idea comes from.

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

Or, if you prefer, you could integrate it into the redirect component as an additional option that can be used across the entire site.

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

As you seem to be spending a lot of time at the moment working on optimising the UX iin terms of using TinyMCE, I can certainly see where the idea comes from.
I can’t say I’m entirely convinced that a menu item, of all things, is the right choice for something like this, but I understand where the idea comes from.

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

Or, if you prefer, you could integrate it into the redirect component as an additional option that can be used across the entire site.

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

I can’t say I’m entirely convinced that a menu item, of all things, is the right choice for something like this, but I understand where the idea comes from.

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

Or, if you prefer, you could integrate it into the redirect component as an additional option that can be used across the entire site.

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

I can’t say I’m entirely convinced that a menu item, of all things, is the right choice for something like this, but I understand where the idea comes from.

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

Or, if you prefer, you could try to integrate it into the redirect component (not sure if as not lookued up yet) as an additional option that can be used across the entire site.

avatar LadySolveig
LadySolveig - comment - 24 Aug 2026

I can’t say I’m entirely convinced that a menu item, of all things, is the right choice for something like this, but I understand where the idea comes from.

Why not at least make it consistent and add an opt-in for a redirect here (Menu Item Type: System Links -> URL), just as we have in the alias, if you really want to?

Or, if you prefer, you could try to integrate it into the redirect component (not sure if really possible as not lookued up yet) as an additional option that can be used across the entire site.

avatar HLeithner
HLeithner - comment - 26 Aug 2026

Technically you are all right, a menuitem is not a redirect component. Never the less it's pretty annoying if you have a 404 if we can do the right thing.

So both should be don't, that Benjamin did and also route::_ should resolve the URL and directly link to the URL.

avatar HLeithner
HLeithner - comment - 26 Aug 2026

Technically you are all right, a menuitem is not a redirect component. Never the less it's pretty annoying if you have a 404 if we can do the right thing.

So both should be done, that Benjamin did and also route::_ should resolve the URL and directly link to the URL.

avatar richard67
richard67 - comment - 26 Aug 2026

So both should be don't

@HLeithner “don‘t“? Or „done“?

avatar LadySolveig
LadySolveig - comment - 26 Aug 2026

I would simply make it the same way as in alias. something that our users are already used to. I don’t think anyone here was trying to block, just trying to play it safe.

avatar LadySolveig
LadySolveig - comment - 26 Aug 2026

I would simply make it the same way as in alias. something that our users are already used to. I don’t think anyone here was trying to block, just trying to play it safe. But TBH I think, we both only mentioned it, so nothing that blocks really blocks here.

avatar LadySolveig
LadySolveig - comment - 26 Aug 2026

I would simply make it the same way as in alias. something that our users are already used to. I don’t think anyone here was trying to block, just trying to play it safe. But TBH I think, we both only mentioned it, so nothing that really blocks here.

avatar LadySolveig
LadySolveig - comment - 26 Aug 2026

I would simply make it the same way as in alias. something that our users are already used to. I don’t think anyone here was trying to block, just trying to play it safe. But TBH I think, we both only mentioned it and made suggestions, so nothing that really blocks here.

avatar LadySolveig
LadySolveig - comment - 26 Aug 2026

I would simply make it the same way as in alias. something that our users are already used to. I don’t think anyone here was trying to block, just trying to play it safe. But TBH I think, we both only mentioned it and made suggestions, so nothing that really blocks here.
When I lookup the commits that was exactlly the initial commit, so would have been easy to say, why it was removed then.

avatar HLeithner
HLeithner - comment - 26 Aug 2026

So both should be don't

@HLeithner “don‘t“? Or „done“?

Autocorrect... It shloud be "done"

avatar Fedik
Fedik - comment - 28 Aug 2026

After relooking the code I think the PR is fine for what it is.
Sorry for the confusion :)

avatar Fedik
Fedik - comment - 28 Aug 2026

After relooking the code I think the PR is fine for what it is.
Sorry for the confusion :)

Need also test if path access also works, eg /blabla/alias-for-url-menu

avatar richard67 richard67 - change - 29 Aug 2026
Labels Removed: Language Change
avatar richard67
richard67 - comment - 29 Aug 2026

Need also test if path access also works, eg /blabla/alias-for-url-menu

@chmst @brianteeman Could you test this PR again regarding this aspect? Your previous test for the testing instructions should still be valid as there has not been made any change on code, so I think it just needs to test that part. Thanks in advance.

avatar brianteeman
brianteeman - comment - 29 Aug 2026

MENU1 = top level menu item URL
MENU2 = child level menu item URL
MENU3 = top level menu alias pointint to menu 1

Before PR

Test the menu items directly

Menu 1 ✔️
Menu 2 ✔️
Menu 3 ✖️

Test the menu item inserted into article

Menu 1 ✖️
Menu 2 ✖️
Menu 3 ✖️

After PR

Test the menu items directly

Menu 1 ✔️
Menu 2 ✔️
Menu 3 ✔️

Test the menu item inserted into article

Menu 1 ✔️
Menu 2 ✔️
Menu 3 ✖️

avatar brianteeman
brianteeman - comment - 29 Aug 2026

MENU1 = top level menu item URL
MENU2 = child level menu item URL
MENU3 = top level menu alias pointing to menu 1

Before PR

Test the menu items directly

Menu 1 ✔️
Menu 2 ✔️
Menu 3 ✖️

Test the menu item inserted into article

Menu 1 ✖️
Menu 2 ✖️
Menu 3 ✖️

After PR

Test the menu items directly

Menu 1 ✔️
Menu 2 ✔️
Menu 3 ✔️

Test the menu item inserted into article

Menu 1 ✔️
Menu 2 ✔️
Menu 3 ✖️

avatar chmst chmst - test_item - 6 Oct 2026 - Tested successfully
avatar chmst
chmst - comment - 6 Oct 2026

I have tested this item ✅ successfully on 632c5fb


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

avatar chmst chmst - test_item - 6 Oct 2026 - Tested successfully
avatar chmst
chmst - comment - 6 Oct 2026

I have tested this item ✅ successfully on 632c5fb


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

avatar chmst
chmst - comment - 6 Oct 2026

I have tested this item ✅ successfully on 632c5fb


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

avatar chmst
chmst - comment - 6 Oct 2026

I have tested this item ✅ successfully on 632c5fb


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

avatar chmst
chmst - comment - 6 Oct 2026

Tested this PR together with #48138.

avatar tecpromotion tecpromotion - test_item - 6 Oct 2026 - Tested unsuccessfully
avatar tecpromotion
tecpromotion - comment - 6 Oct 2026

I have tested this item 🔴 unsuccessfully on 632c5fb

The described case works, but the redirect bypasses the menu item's access level.

Tested on 632c5fb (6.2-dev, PHP 8.3, SEF on, no URL rewriting), as guest, with curl; baseline = same instance with the patch reverted.

Testing instructions: index.php?Itemid=<url item> and /index.php/<alias> → 404 before, 301 to the configured URL after.
Child URL items and index.php?option=… links (→ SEF URL) work too.

Findings

1. Access level is ignored (blocker). The redirect runs before $this->authorise($Itemid), so a guest gets the target of a Registered/Special URL menu item.

Request (guest) Before After
index.php?Itemid=108 (access Registered) 303 → login 301 → https://secret.example.org/internal?token=abc
/index.php/u-reg (same item) 303 → login 301 → same
index.php?Itemid=109 (access Special) 303 → login 301 → https://secret.example.org/special

Item IDs are sequential, so the links of all restricted URL items can be enumerated.

2. Links that are not http(s) or index.php? produce wrong redirects. redirect() prefixes everything else with the site base:

Menu item link Location after
# (common placeholder parent) …/# — home page (via /index.php/u-hash: …/index.php/#)
mailto:test@example.org …/mailto:test@example.org → 404
javascript:void(0) …/javascript:void(0) → 404
images/x.png …/images/x.png via Itemid, …/index.php/images/x.png via SEF path → 404
index.php?Itemid=<own id> redirects to itself, endless loop

3. Any request carrying the Itemid is redirected, e.g. index.php?option=com_content&view=featured&Itemid=102 rendered the component before (200), now 301 to the external URL.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48219.
avatar tecpromotion
tecpromotion - comment - 6 Oct 2026

I have tested this item 🔴 unsuccessfully on 632c5fb

The described case works, but the redirect bypasses the menu item's access level.

Tested on 632c5fb (6.2-dev, PHP 8.3, SEF on, no URL rewriting), as guest, with curl; baseline = same instance with the patch reverted.

Testing instructions: index.php?Itemid=<url item> and /index.php/<alias> → 404 before, 301 to the configured URL after.
Child URL items and index.php?option=… links (→ SEF URL) work too.

Findings

1. Access level is ignored (blocker). The redirect runs before $this->authorise($Itemid), so a guest gets the target of a Registered/Special URL menu item.

Request (guest) Before After
index.php?Itemid=108 (access Registered) 303 → login 301 → https://secret.example.org/internal?token=abc
/index.php/u-reg (same item) 303 → login 301 → same
index.php?Itemid=109 (access Special) 303 → login 301 → https://secret.example.org/special

Item IDs are sequential, so the links of all restricted URL items can be enumerated.

2. Links that are not http(s) or index.php? produce wrong redirects. redirect() prefixes everything else with the site base:

Menu item link Location after
# (common placeholder parent) …/# — home page (via /index.php/u-hash: …/index.php/#)
mailto:test@example.org …/mailto:test@example.org → 404
javascript:void(0) …/javascript:void(0) → 404
images/x.png …/images/x.png via Itemid, …/index.php/images/x.png via SEF path → 404
index.php?Itemid=<own id> redirects to itself, endless loop

3. Any request carrying the Itemid is redirected, e.g. index.php?option=com_content&view=featured&Itemid=102 rendered the component before (200), now 301 to the external URL.


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

Add a Comment

Login with GitHub to post a comment