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.
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.
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.
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.
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
Reported and discussed at the Joomla! Forum as "Not acceptable REDIRECT bug" at https://forum.joomla.org/viewtopic.php?f=816&t=991546
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
@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.
"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.
@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.
@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
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-06-16 12:22:16 |
Closed_By | ⇒ | richard67 |
@toivo Have you also switched on "Use URL Rewriting" in the backend? Or only "Search Engine Friendly URLs"?