No Code Attached Yet
avatar rhellyer
rhellyer
11 Dec 2023

Steps to reproduce the issue

  1. Create a hidden menu for content>>single article with an alias 'essays' (note that all aliases appear to be forced to be lowercase)
  2. create a htaccess rewrite rule to pass control to a specific article such as
RewriteCond %{REQUEST_URI} ^/(Essays|essays)/.*\.shtml$ 
RewriteRule (Essays/foo.html) /index.php?option=com_content&view=article&id=32&Itemid=113&archive=$1 [L]
  1. navigate to example.com/Essays/foo.html in joomla 3, and then in joomla 4
  2. test this with a similar url but all lowercase example.com/essays/foo.html

Expected result

It is expected that the URL would result in the same page and to be correctly processed by the component for the 'essays' menu item whether using J3 or J4.

Actual result

This works fine in Joomla 3, but not in Joomla 4 which creates a 404 error
If one uses the lowercase version, it works OK

System information (as much as possible)

It appears that the Joomla 3 router parse rules (SiteRouter.php / function parseSefRoute() use strtolower on the uri path before making comparisons with the available menu item aliases. However the Joomla 4 equivalent does not.

For example in Joomla 3 the relevant search for matching menu items is made with the test:

if ($item->route === $route_lowercase)

where $route_lowercase has been created using strtolower()

in Joomla 4 the corresponding test is

if ( $item->alias == $segment ... )

without the $segment having been forced to lowercase.

Additional comments

This is an issue backward compatibility in a number of cases. If faced with this issue the user appears to have only the alternative of forcing a redirect for URL's that contain upper case (redirect versus internal rewrite) and in so doing may lose pagerank for valuable pages

avatar rhellyer rhellyer - open - 11 Dec 2023
avatar joomla-cms-bot joomla-cms-bot - change - 11 Dec 2023
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Dec 2023
avatar richard67
richard67 - comment - 11 Dec 2023

Is it a duplicate report to #38257 ?

avatar richard67
richard67 - comment - 11 Dec 2023

See also #39560 .

avatar Fedik Fedik - change - 11 Dec 2023
Status New Closed
Closed_Date 0000-00-00 00:00:00 2023-12-11 12:18:11
Closed_By Fedik
avatar Fedik Fedik - close - 11 Dec 2023
avatar Fedik
Fedik - comment - 11 Dec 2023

Closing as duplicate of #38257

Add a Comment

Login with GitHub to post a comment