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

[5.2] SEF: Don't remove trailingslash on hp in a subdir #44205

Merged
merged 2 commits into from
Oct 8, 2024

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Oct 8, 2024

Summary of Changes

When running an installation in a subdirectory with strict routing enabled, the last slash is removed and a redirect is executed, breaking for example the login. This PR fixes that. A big thanks goes to @LadySolveig, who reported this.

Testing Instructions

Install a Joomla 5.2.0 or use an updated site in a subdirectory. In case of an updated site, enable strict routing in the SEF system plugin. Make sure that the site is using URL rewriting. Login on the frontend.

Actual result BEFORE applying this Pull Request

Login doesn't work.

Expected result AFTER applying this Pull Request

Login works.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@richard67
Copy link
Member

richard67 commented Oct 8, 2024

Hmm, I could only reproduce the issue when switching on "Use URL Rewriting" in Global Config and having a standard .htaccess file in addition to what's described.

I made a new installation of 5.2.0-rc3 in a subfolder. The parent folder which is the webserver root is empty except of that subfolder. Then I have tried frontend login and it worked. Then I've switched on "Use URL Rewriting" in Global Config and copied htaccess.txt to .htaccess. After that I could reproduce the issue.

Then I have switched off "Use URL Rewriting" in Global Config but kept the .htaccess file, and then frontend login worked again.

@Hackwar Can you confirm? If so, could you update testing insctructions?

@Hackwar
Copy link
Member Author

Hackwar commented Oct 8, 2024

I'm sorry, yes, you have to enable URL rewriting as well. I'm going to update the test instructions.

@richard67
Copy link
Member

I have tested this item ✅ successfully on 0ccbdfe

I was able to reproduce the issue (5.2.0-rc3 in a subfolder with URL Rewriting enabled and a standard .htaccess file present) and have verified that this PR fixes the issue.

I've also checked that with a "normal" installation not in a subfolder and URL Rewriting enabled everything works as well as before.

Finally I've checked on both installations that without URL rewriting everything works as well as before.


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

@tecpromotion
Copy link
Contributor

I have tested this item ✅ successfully on 61e5256

Without the patch, the frontend login via the login module does not work. I was able to test this successfully with the patch.

As a note, the login also works without a patch via https://yoururl.tld/joomla-in-subfolder/component/users/login


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

@dautrich
Copy link

dautrich commented Oct 8, 2024

Couldn't reproduce the issue on my local test installation (Laragon). Login works under the conditions given with or without the patch.

@richard67
Copy link
Member

Couldn't reproduce the issue on my local test installation (Laragon). Login works under the conditions given with or without the patch.

It needs to use the module, not a menu item for the login, and the Joomla has to be in a subfolder, and URL rewriting has to be switched on and a standard .htaccess has to be in the subfolder.

@Hackwar
Copy link
Member Author

Hackwar commented Oct 8, 2024

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 8, 2024
@dautrich
Copy link

dautrich commented Oct 8, 2024

@richard67 I used a menu item for the login. Anyway, there a two successful tests, and the PR is RTC.

@tecpromotion
Copy link
Contributor

@richard67 I used a menu item for the login. Anyway, there a two successful tests, and the PR is RTC.

module in sidebar is the trick

@LadySolveig
Copy link
Contributor

Thank you all 💚

@LadySolveig
Copy link
Contributor

I have tested this item ✅ successfully on 61e5256


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

@bembelimen bembelimen merged commit d48372e into joomla:5.2-dev Oct 8, 2024
4 of 5 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 8, 2024
@bembelimen
Copy link
Contributor

Thanks for the fix @Hackwar and for the tests @richard67 @tecpromotion and for the find + test @LadySolveig

@bembelimen bembelimen added this to the Joomla! 5.2.0 milestone Oct 8, 2024
richard67 added a commit that referenced this pull request Oct 8, 2024
[5.3] Upmerge 2024-10-08:
- [4.4] Update NPM developer dependencies braces, fill-range, micromatch and rollup #44159 
- [4.4] Fix the actions menu in the admin isn't working on mobile #44199 
- [5.2][GuidedTours] replace deprecated access of input property #44195 
- [5.2] Translation Update #44191 
- [5.2] SEF: Don't remove trailingslash on hp in a subdir #44205
@Hackwar Hackwar deleted the 5.2-sef-slash-fix branch November 24, 2024 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants