No Code Attached Yet
avatar toivo
toivo
14 Jun 2022

The plugin System - Redirects that works both in Joomla 3.10.10-dev and 4.2.0-beta2-dev does not work Joomla 4.1.

Steps to reproduce the issue

Install a new site from Joomla 4.1.5-rc2-dev in Nightly Builds. The domain is shown here as example.com.
Rename htaccess.txt to .htaccess. Enable SEF URLs.
Create an article, 'My Article'.
Go to Menus, add to Main Menu, select menu entry type 'Single Article', select 'My Article' and set the title of the menu item to 'Target'.
Go to System - Manage - Plugins and search for 'redirect'. Enable the plugin 'System - Redirect'.
Go to the front end of the website.
Enter the URL http://example.com/zzzzzz
Go to System - Manage - Redirects.
According to the information message at the top of the page, "The Redirect Plugin is enabled. The option 'Collect URLs' is enabled."
Click 'Add New Link'.
Enter the following information:
Expired URL: zzzzzz
New URL: target
Make sure the status is 'Enabled'. Save and Close.

Test 1
Browse to http://example.com/zzzzzz
Test 2
Browse to http://example.com/xxxxxx
Go to System - Plugins - Redirects.

Expected result

Test 1 - page redirected to http://example.com/target
Test 2 - '404 Not Found' page but URL xxxxxx with status 'Disabled' added to the list of URLs in System - Plugins - Redirects so that the New URL can be updated.
Both Joomla 3.10.10-dev and 4.2.0-beta2-dev work this way.

Actual result

The first page:
'404 Not Found' page with the message:
"Not Found
The requested URL was not found on this server.
Apache/2.4.53 (Win64) PHP/8.0.15 mod_fcgid/2.3.10-dev Server at example.com Port 80"
The second page:
The same error message '404 Not Found' as in the first page but the URL is not added to the list.

System information (as much as possible)

Windows 10, Wampserver 3.2.9, Apache 2.4.53, MySQL 8.0.27, PHP 8.0.15
Joomla 4.1.5-rc2-dev of 14 June

Additional comments

Reported and discussed at the Joomla! Forum as "Not acceptable REDIRECT bug" at https://forum.joomla.org/viewtopic.php?f=816&t=991546

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
5.00

avatar toivo toivo - open - 14 Jun 2022
avatar toivo toivo - change - 14 Jun 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 14 Jun 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 Jun 2022
avatar richard67
richard67 - comment - 16 Jun 2022

Enable SEF URLs.

@toivo Have you also switched on "Use URL Rewriting" in the backend? Or only "Search Engine Friendly URLs"?

avatar richard67
richard67 - comment - 16 Jun 2022

@toivo Next question. Before the "Test 1", the testing instructions say:

Go to System - Manage - Plugins and search for 'redirect'. Enable the plugin 'System - Redirect'.
Go to the front end of the website.
Enter the URL http://example.com/zzzzzz
Go to System - Manage - Redirects.
According to the information message at the top of the page, "The Redirect Plugin is enabled. The option 'Collect URLs' is enabled."
Click 'Add New Link'.
Enter the following information:
Expired URL: zzzzzz
New URL: target
Make sure the status is 'Enabled'. Save and Close.

But when I enable the plugin it already collects URLs, so when I check the redirects in "System - Manage - Redirects" after the "Enter the URL http://example.com/zzzzzz" step, there is already a redirect with code 301.

So shall I really add a new redirect after that? Or shall I edit that one which just has been created by the redirect plugin?

Next question. You write Expired URL: zzzzzz and New URL: target. But when I edit a redirect, the Expired URL is always an absolute URL, i.e. in your description I would expect Expired URL: http://example.com/zzzzzz and New URL: http://example.com/target. Have you done it like that? Or have you used relative target URL?

The best would be you post screenshots of the 2 redirects in edit mode so we can see the right URLs and not the shortened zzzzzz from the list view.

Beside that, when I had edited the first redirect created by the plugin as first and redirected to the absolute URL of that single article page, your Tests 1 and 2 work as expected in the same way on 4.1-dev and 4.2-dev.

So I can't reproduce the issue, and I know that other maintainers could not reproduce it either up to now.

avatar toivo
toivo - comment - 16 Jun 2022

"Use URL Rewriting" in the backend? Or only "Search Engine Friendly URLs"?

@richard67 both options were selected but when I installed this test site, I forgot to rename htaccess.txt to .htaccess, which I have just done and the plugin is working as expected - it redirects and collects URLs, too.

avatar richard67
richard67 - comment - 16 Jun 2022

@toivo Hmm, what shall we do now if you can't reproduce the issue anymore? Close it? But what shall we do then with the forum post?

avatar richard67
richard67 - comment - 16 Jun 2022

@toivo If the guy who had the issue in the forum post was on Windows and has the folder options setting to hide extensions for known file types switched on (which is unfortunately the default on Windows since version 7 or so), he might maybe not have an .htaccess file but an .htaccess.txt file and doesn't notice that? That's the only theory I have right now.

avatar toivo
toivo - comment - 16 Jun 2022

@toivo Hmm, what shall we do now if you can't reproduce the issue anymore? Close it? But what shall we do then with the forum post?

@richard67 The item can be closed. I will reply the forum topic and mention that there is an issue if there is no .htaccess file. The Help page is very clear about this: https://help.joomla.org/proxy?keyref=Help41:Redirects:_Links&lang=en#:~:text=In%20order%20for%20your,Joomla!%20to%20.htaccess

avatar richard67 richard67 - close - 16 Jun 2022
avatar richard67
richard67 - comment - 16 Jun 2022

Closing as stated above. Thanks @toivo for your cooperation and all the work you do in the forum and here.

avatar richard67 richard67 - change - 16 Jun 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-06-16 12:22:16
Closed_By richard67

Add a Comment

Login with GitHub to post a comment