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

Backward Compatability for URL's with upper case characters in path #42492

Closed
rhellyer opened this issue Dec 11, 2023 · 3 comments
Closed

Backward Compatability for URL's with upper case characters in path #42492

rhellyer opened this issue Dec 11, 2023 · 3 comments

Comments

@rhellyer
Copy link

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

@richard67
Copy link
Member

Is it a duplicate report to #38257 ?

@richard67
Copy link
Member

See also #39560 .

@Fedik
Copy link
Member

Fedik commented Dec 11, 2023

Closing as duplicate of #38257

@Fedik Fedik closed this as completed Dec 11, 2023
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

4 participants